-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
timestamp flag #987
timestamp flag #987
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add test cases to test the new functionality. Also update the manual.md
to reflect the new features.
Which part of the manual.md ? The full example ? There isn't much details on specific flags on the manual, It seems like most of the doc is auto generated through GoDoc |
What I meant was that you add an example of using the timestamp flag as I think this is a unique flag, and users would appreciate an example on how to use it in their application. |
@drov0 If I initialize a timestamp flag without any default layout value, what layout is considered for the flag? Do you think having a default out of the box value for the layout would help? |
1 similar comment
@drov0 If I initialize a timestamp flag without any default layout value, what layout is considered for the flag? Do you think having a default out of the box value for the layout would help? |
@asahasrabuddhe, okay for the manual, will add on monday. As for the layout It won't work if you don't set it, the layout is mandatory. I considered having a default value but since there are so many different layouts, I figured that people would almost always use a custom layout anyways. Kind of like |
Fair enough. I think once we have an example, we are good to go 👍 |
@asahasrabuddhe I added examples at the end in the full example, is that ok or would you rather that I add a complete new section for it ? |
@drov0 thanks for adding this feature. @lynncyrin any chance we can get this into a minor release (2.0.1 perhaps)? Would love to use the timestamp flag in my application with the proper go.mod routine. |
I'll draft a release soon 👍 |
=> #1013 |
It's released 🚢 => https://github.com/urfave/cli/releases/tag/v2.1.0 |
Fixes #696
Changes
This is a simple flag to add the support for timestamps. At first this flag was using protobuf timestamps but I ended up editing it since I figured you would be more interested in something more general. But if you guys are interested I would love to make a protobuf timestamp as well. (saves a few lines on my app code)
Reviewer Guidelines
I'm not sure if this code works with env variables. I tried to take inspiration from int64_slice and string_slice since those were the only flag that didn't use the default set from golang's
Flag
I am open to any changes you see fit.