You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
if *matches.get_one::<bool>("headers-in").unwrap_or(&false) {
.... something ...
}
Additional Context
I'm struggling with the source code a bit, however I imagine a hashmap of aliases to an iterable of args. The value of the alias would be the value which is given to the original arguments.
The text was updated successfully, but these errors were encountered:
We have the unstable feature Command::replace that is meant to help with cases like this. The tracking issue is #2836. No one has stepped up to see it completed though.
Another option is to use default_value_if. It would look something like
Please complete the following tasks
Clap Version
3.2.17
Describe your use case
My use case is reproducing something along of this feature:
-H
Same as ‘--header-in --header-out’. A short option indicating the input file has a header line, and the output should contain a header line as well
.So basically, an boolean flag which enables two other flags. Currently, clap does not permit this:
'short option names must be unique, but '-H' is in use by both 'headers-in' and 'headers-out''
Describe the solution you'd like
Ideally, the code should be allowed to look like this:
and the invocation would then look something like:
Alternatives, if applicable
Right now, the alternative is to have a complicated condition in
if
:Code right now:
Ideally, this should look like
Additional Context
I'm struggling with the source code a bit, however I imagine a hashmap of aliases to an iterable of args. The value of the alias would be the value which is given to the original arguments.
The text was updated successfully, but these errors were encountered: