-
Notifications
You must be signed in to change notification settings - Fork 33
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
Display an error/warning when mutually exclusive flags are set in scope #611
Comments
It makes more sense to notify the user of error, to avoid unexpected results; and to avoid discovering a bug. In cobra there is an option to create flag sets but this appears to have limitations. It is easier to write conditions that check for invalid combinations, and return an error to the user. We should:
|
|
QA INSTRUCTIONS Part 1
Expect: |
I found one small thing during the bugathon of this with 1.0.2-rc0. I'll write it up in #839. In all other ways, this looks great! |
These combinations of flags should probably throw a user error or warning message:
(with scope run):
--cribldest
&&--eventdest
--cribldest
&&--metricsdest
--userconfig
&& (--metricsdest
||--eventsdest
||--cribldest
||--loglevel
....etc)--passthrough
&& [anything else]Considerations
Currently scope proceeds for all of these combinations, silently overriding or bypassing mutually exclusive flags. Should we warn and let scope proceed anyway? Should we throw an error and have the user fix their arguments?
Related: spf13/cobra#1216
The text was updated successfully, but these errors were encountered: