mirror of
https://github.com/clap-rs/clap
synced 2025-03-04 07:17:26 +00:00
docs(builder): Add help text
This commit is contained in:
parent
b03b60edd1
commit
e644a5ef66
2 changed files with 23 additions and 3 deletions
|
@ -4,11 +4,31 @@ A simple to use, efficient, and full-featured Command Line Argument Parser
|
|||
|
||||
Usage: 04_01_enum[EXE] <MODE>
|
||||
|
||||
Arguments:
|
||||
<MODE>
|
||||
What mode to run the program in
|
||||
|
||||
Possible values:
|
||||
- fast: Run swiftly
|
||||
- slow: Crawl slowly but steadily
|
||||
|
||||
Options:
|
||||
-h, --help
|
||||
Print help information (use `-h` for a summary)
|
||||
|
||||
-V, --version
|
||||
Print version information
|
||||
|
||||
$ 04_01_enum -h
|
||||
A simple to use, efficient, and full-featured Command Line Argument Parser
|
||||
|
||||
Usage: 04_01_enum[EXE] <MODE>
|
||||
|
||||
Arguments:
|
||||
<MODE> What mode to run the program in [possible values: fast, slow]
|
||||
|
||||
Options:
|
||||
-h, --help Print help information
|
||||
-h, --help Print help information (use `--help` for more detail)
|
||||
-V, --version Print version information
|
||||
|
||||
$ 04_01_enum fast
|
||||
|
|
|
@ -14,8 +14,8 @@ impl ValueEnum for Mode {
|
|||
|
||||
fn to_possible_value<'a>(&self) -> Option<PossibleValue> {
|
||||
Some(match self {
|
||||
Mode::Fast => PossibleValue::new("fast"),
|
||||
Mode::Slow => PossibleValue::new("slow"),
|
||||
Mode::Fast => PossibleValue::new("fast").help("Run swiftly"),
|
||||
Mode::Slow => PossibleValue::new("slow").help("Crawl slowly but steadily"),
|
||||
})
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue