-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
unset default value if some other Arg is present (or has a specific value) #1406
Comments
@Moongoodboy-K suggests |
That's a really important feature! |
Instead of creating a new method, could the signature of |
Good idea (fwiw). The parameter type could even change without adding to the version 3 migration burden with |
@logansquirel And then you can take this. |
Rust Version
rustc 1.32.0 (9fda7c223 2019-01-16)
Affected Version of clap
2.32.0
Feature Request Summary
Some way to unset the default value for an Arg based on the presence or value of some other Arg. One alternative the current API allows is to pass the empty string (or some other value that means nothing) to
Arg::default_value_if
(at the expense of additional code to treatSome("")
likeNone
):The signature I’m imagining looks something like:
The text was updated successfully, but these errors were encountered: