mirror of
https://github.com/clap-rs/clap
synced 2024-11-10 06:44:16 +00:00
docs(cookbook): Correct a typo
This commit is contained in:
parent
9cc4fe8cc2
commit
55923ca947
2 changed files with 4 additions and 4 deletions
|
@ -12,7 +12,7 @@ Options:
|
|||
--sleep <SLEEP> Allow human-readable durations
|
||||
-D <DEFINES> Hand-written parser for tuples
|
||||
--port <PORT> Support for discrete numbers [default: 22] [possible values: 22, 80]
|
||||
--log-level <LOG_LEVEL> Support enums from a foreign crate that don't implement `ValueEnum` [default: info] [possible values: info, debug, info, warn, error]
|
||||
--log-level <LOG_LEVEL> Support enums from a foreign crate that don't implement `ValueEnum` [default: info] [possible values: trace, debug, info, warn, error]
|
||||
-h, --help Print help
|
||||
|
||||
```
|
||||
|
@ -117,14 +117,14 @@ Args { optimization: None, include: None, bind: None, sleep: None, defines: [],
|
|||
$ typed-derive --log-level
|
||||
? failed
|
||||
error: a value is required for '--log-level <LOG_LEVEL>' but none was supplied
|
||||
[possible values: info, debug, info, warn, error]
|
||||
[possible values: trace, debug, info, warn, error]
|
||||
|
||||
For more information, try '--help'.
|
||||
|
||||
$ typed-derive --log-level critical
|
||||
? failed
|
||||
error: invalid value 'critical' for '--log-level <LOG_LEVEL>'
|
||||
[possible values: info, debug, info, warn, error]
|
||||
[possible values: trace, debug, info, warn, error]
|
||||
|
||||
For more information, try '--help'.
|
||||
|
||||
|
|
|
@ -38,7 +38,7 @@ struct Args {
|
|||
#[arg(
|
||||
long,
|
||||
default_value_t = foreign_crate::LogLevel::Info,
|
||||
value_parser = clap::builder::PossibleValuesParser::new(["info", "debug", "info", "warn", "error"])
|
||||
value_parser = clap::builder::PossibleValuesParser::new(["trace", "debug", "info", "warn", "error"])
|
||||
.map(|s| s.parse::<foreign_crate::LogLevel>().unwrap()),
|
||||
)]
|
||||
log_level: foreign_crate::LogLevel,
|
||||
|
|
Loading…
Reference in a new issue