Using default_missing_value without require_equals. #5519
-
Is there any way to specify a default missing value without requiring an equal sign in the argument? I have tried adding require_equals=false, and this seems to work in normal use cases. In what situations would it fail? The desired usage is shown: |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
In this situation, there are three properties at play
For example, in cargo we made the choice that subcommands that use |
Beta Was this translation helpful? Give feedback.
In this situation, there are three properties at play
default_missing_value
require_equals
num_args
require_equals
is a recommendation related tonum_args
, notdefault_missing_value
. See https://docs.rs/clap/latest/clap/struct.Arg.html#method.num_argsFor example, in cargo we made the choice that subcommands that use
num_args(0..=1)
cannot have positional arguments.