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

Support Boolean flags with only NoOptDefVal, no --foo=true syntax. #214

Open
sixolet opened this issue Aug 8, 2019 · 2 comments
Open

Support Boolean flags with only NoOptDefVal, no --foo=true syntax. #214

sixolet opened this issue Aug 8, 2019 · 2 comments

Comments

@sixolet
Copy link

sixolet commented Aug 8, 2019

Rationale: the flag --no-shave-yaks alone is pretty clear: I don't want the program to shave any yaks. However --no-shave-yaks=true and --no-shave-yaks=false both get me confused with exactly how much negation I'm applying to all this yak-shaving.

@Nuru
Copy link

Nuru commented Oct 3, 2019

I am in favor of pairing --no-shave-yaks with --shave-yaks and disallowing --no-shave-yaks=true and --no-shave-yaks=false as overly confusing.

However, thinking about the various use cases where a command might be scripted, if we enforce/automatically create --no-shave-yaks and --shave-yaks in pairs, then I would like to keep the ability to set --shave-yaks=true and --shave-yaks=false. This would allow one to propagate or group a variable setting without having to have a more complicated conditional substitution. For example:

export GROOMING=false

command --shave-yaks=${GROOMING}

A similar case (easier scripting) could be made for allowing --no-shave-yaks=false, but I agree it is too confusing.

@feluelle
Copy link

What is the status of this issue? I would love to have this as well.

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

3 participants