Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upv2 feature: Add optional check for duplicated string and int type flags. #1071
Comments
Oh wow that sucks |
|
This issue or PR has been automatically marked as stale because it has not had recent activity. Please add a comment bumping this if you're still interested in it's resolution! Thanks for your help, please let us know if you need anything else. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Checklist
What problem does this solve?
Sometimes users can accidently duplicate string type flags and then the latest value we be taken. It is not clear and bad for usability.
Solution description
Add an option called Duplicated true\false to flag options. Example:
A detailed description of what you want to happen.
if Duplicated set to false command should fail with error
"flag foo can not be duplicated"
Describe alternatives you've considered
For now, as a workaround, we're using StringSliceType for flags we don't want to be duplicated and check that slice have only one element in it.
https://github.com/Venafi/vcert/blob/8e1dc13c0afdd615d7f27b80190ddf3a1d07e848/cmd/vcert/commands.go#L105-L120