Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extra dependency for Time and Duration #8

Closed
suntong opened this issue May 25, 2016 · 8 comments
Closed

Extra dependency for Time and Duration #8

suntong opened this issue May 25, 2016 · 8 comments

Comments

@suntong
Copy link
Collaborator

suntong commented May 25, 2016

The example-14-time-and-duration reveals that for a normal Time and Duration operation, an extra package is required, github.com/jinzhu/now.

Since Time and Duration operations are such normal operations, I'm wondering why such extra package is necessary.

Excellent package, BTW.

Thanks

@suntong
Copy link
Collaborator Author

suntong commented May 25, 2016

The example-15-file need that package as well. This seems even less obvious as all it's doing is to read content from file or stdin, which doesn't relate to a now package much.

@mkideal
Copy link
Owner

mkideal commented May 26, 2016

I did not realize it was a problem before,😭 .I just want to support more formats to parse time. Well, it's a defect!

@suntong
Copy link
Collaborator Author

suntong commented May 26, 2016

Oh, thanks for looking that way. By "support more formats to parse time", I presume you mean how to specify the duration. If so, I found the go's default flag's handling of the duration strings is quite superb. In fact, I was quite amaze how good it can handle all those difference cases.

Once again, Excellent package!

I blogged about "Passing options to Go from command line" before. I.e., I had a pretty extensive study of all the choices available (by then), and I'm really glad to have come across your new CLI now. Yours is by far the best.

I'll sure to blog again about it and prompt it.

Keep up the good work, :)

@mkideal
Copy link
Owner

mkideal commented May 26, 2016

Thanks a lot! 😄

@suntong
Copy link
Collaborator Author

suntong commented Jun 4, 2016

Hi mkideal,

If it will take a while for you to fix this, could you split the clix.File out from github.com/mkideal/cli/ext please?

I'm switching my code from other implementation to cli, and this clix.File has become a road block for me. Do the splitting will at least give you some time to think more...

Thanks

@mkideal
Copy link
Owner

mkideal commented Jun 5, 2016

I have removed github.com/jinzhu/now

@suntong
Copy link
Collaborator Author

suntong commented Jun 5, 2016

works great. Thx.

@suntong suntong closed this as completed Jun 5, 2016
@suntong
Copy link
Collaborator Author

suntong commented Jun 5, 2016

I believe this is a better option -- I tried passing with the standard time format (-t '2016-01-02 03:04:05'), and it works great.

If someone really need to parse unusual formats instead, s/he can pass it as string and use whatever fancy/powerful tools to do the conversion.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants