-
-
Notifications
You must be signed in to change notification settings - Fork 40
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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
CLI: can bool parameters become --flag
instead of --flag true
?
#355
Comments
Certainly could be implemented. It is a commonly used behavior in many CLIs. This is already available with Note that adding this feature introduces edge cases which might make the CLI usage worse. If true/false is required, when it is not given, there is always an error including For consistency this would need to work with a |
馃殌 Feature request
Currently, while using CLI(), a bool param must be specified on the command line as
--flag true
or--flag yes
. Is it possible to set it up such that--flag
without theyes
ortrue
will still passTrue
into the function?Motivation
I see this commonly tripping up members on my team.
--flag
is a common pattern,store_true
in argparse, supported in python-fire (https://github.com/google/python-fire/blob/master/docs/guide.md#boolean-arguments)Pitch
--flag
should work the same as--flag yes
or--flag true
Alternatives
The text was updated successfully, but these errors were encountered: