Skip to content
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

Handle foo=True args in saner way #6

Open
ekimekim opened this issue Mar 29, 2020 · 0 comments
Open

Handle foo=True args in saner way #6

ekimekim opened this issue Mar 29, 2020 · 0 comments

Comments

@ekimekim
Copy link
Owner

Right now the behaviour is for foo=True to create a --foo arg with store_false, ie. so that --foo means foo=False. This is very counterintuitive.

neithere#73 has some thoughts on this, and I've implemented a similar thing in my own usage previously as an explicit custom Action that adds --foo and --no-foo args.

Open questions:

  • Do we want both --foo and --no-foo, or do we just want --no-foo if the default is foo=True
  • There should still be a way to opt into both --foo and --no-foo, especially if the default is dynamic based on other conditions - the one that comes up a lot personally is something like --color --no-color with default being sys.stdout.isatty().
  • How do we reconcile this with existing behaviour without breaking backwards compatability too badly?
  • Does it make sense to combine this with short args? eg. -f=true/false or -f=yes/no (probably not - if the user wants this they can explicitly use choices=["yes","no"])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant