You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
i just tested and with a subcommand and a flag value with the same -a the one in the subcommand did not work or register an error
not sure if this is an error or just something that should be pointed out in the documentation for the subcommands, and it might be worth adding some kind of validation for duplicate items to warn when using the MustParse method
The text was updated successfully, but these errors were encountered:
If you have an option -a on both the top-level struct and also on a subcommand, then depending on where in the command line you put the -a, you will either be interacting with the top-level or subcommand version of that option:
./my-program -a mysubcommand # goes to the top-level version of the -a option
./my-program mysubcommand -a # goes to the subcommand version of the -a option
I agree this is a bit dicey, actually. I'm worried that it's unhelpful. And you're right that it's not documented! I'll fix that.
i just tested and with a subcommand and a flag value with the same
-a
the one in the subcommand did not work or register an errornot sure if this is an error or just something that should be pointed out in the documentation for the subcommands, and it might be worth adding some kind of validation for duplicate items to warn when using the
MustParse
methodThe text was updated successfully, but these errors were encountered: