should global options be allowed when args_conflicts_with_subcommands? #6182
Unanswered
MichalMaruska
asked this question in
Q&A
Replies: 1 comment
-
|
#6184 fixes the panic Unsure if we should relax the validation around globals. Feel free to create an issue and we can discuss it further. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I want to support this usage:
That is by this code:
Use cases
The following should not be valid:
args_conflicts_with_subcommands indeed makes it fail. But this (args_conflicts_with_subcommands_set) also prevents using the -g option before the sub-command:
unfortunately fails, with a panic. But I would want it to pass, not error.
Patch to enable it
I claim that there is even an undeserved panic ....
args_conflicts_with_subcommands_set triggers checks and error message composition can fail
447f3dd
I tried to exclude global options as exception to the "conflict", in this patch:
9fbca3b
Not having read the whole parse() yet, I am not sure if it's correct -- not breaking other features/use-cases.
Beta Was this translation helpful? Give feedback.
All reactions