-
Notifications
You must be signed in to change notification settings - Fork 152
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
How to define mutually competing flags #320
Comments
AFAIK, no, sorry. Also, related #126
This depends a good deal on the precise design. If you're willing to try implementing this variant, which both @TeXitoi and I agree with, it will be accepted. If you have any other thoughts/improvements - we may need to discuss them first. |
Well this one looks promising but I'm not sure it's good enough:
Then the following:
Would disable debug instead of enabling. I.e. I'm not sure how to implement last argument wins semantics with |
Oh well, actually: #[structopt(long, help="enabled debug (disable with --no-debug)")]
pub debug: bool,
#[structopt(long, overrides_with="debug", hidden=true)]
pub _no_debug: bool, Works pretty well (the key here is The I would still probably want better help, but this is not that critical and should probably be done after clap 3.0. |
Yeah, I was mostly answering to |
There is a common pattern with flags which is like:
or similarly
-v
and-q
could stand as verbose and quiet.The only way I can find to implement it is using two different flags, but there are two problems with that:
Is there a way to implement this now? Will such a feature be accepted?
The text was updated successfully, but these errors were encountered: