mirror of
https://github.com/clap-rs/clap
synced 2024-11-15 00:57:15 +00:00
docs(example): update pseudo-flag
example
This commit is contained in:
parent
7f8f5ccc9a
commit
cf94a5bffa
1 changed files with 1 additions and 4 deletions
|
@ -33,10 +33,7 @@ fn main() {
|
||||||
// Sometimes we might want to accept one of the following: `--pseudo-flag`, `--pseudo-flag=true`, `--pseudo-flag=false.`
|
// Sometimes we might want to accept one of the following: `--pseudo-flag`, `--pseudo-flag=true`, `--pseudo-flag=false.`
|
||||||
// The following is the `pseudo-flag` pattern stated in https://github.com/clap-rs/clap/issues/1649#issuecomment-661274943
|
// The following is the `pseudo-flag` pattern stated in https://github.com/clap-rs/clap/issues/1649#issuecomment-661274943
|
||||||
Arg::new("pseudo-flag") // Create a "pesudo-flag" with optional value
|
Arg::new("pseudo-flag") // Create a "pesudo-flag" with optional value
|
||||||
.possible_values(&["true", "false"]) // Limit that value to `true` of `false`
|
.possible_values(&["true", "false"]), // Limit that value to `true` of `false`
|
||||||
.long("pseudo-flag")
|
|
||||||
.min_values(0)
|
|
||||||
.max_values(1),
|
|
||||||
)
|
)
|
||||||
.arg("-c, --config=[FILE] 'sets a custom config file'")
|
.arg("-c, --config=[FILE] 'sets a custom config file'")
|
||||||
.arg("<output> 'sets an output file'")
|
.arg("<output> 'sets an output file'")
|
||||||
|
|
Loading…
Reference in a new issue