mirror of
https://github.com/clap-rs/clap
synced 2025-03-04 07:17:26 +00:00
docs(derive): Add help text
This commit is contained in:
parent
39fe46e650
commit
b1c05bcecb
2 changed files with 25 additions and 1 deletions
|
@ -4,11 +4,31 @@ A simple to use, efficient, and full-featured Command Line Argument Parser
|
|||
|
||||
Usage: 04_01_enum_derive[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_derive -h
|
||||
A simple to use, efficient, and full-featured Command Line Argument Parser
|
||||
|
||||
Usage: 04_01_enum_derive[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_derive fast
|
||||
|
|
|
@ -10,7 +10,11 @@ struct Cli {
|
|||
|
||||
#[derive(Copy, Clone, PartialEq, Eq, PartialOrd, Ord, ValueEnum)]
|
||||
enum Mode {
|
||||
/// Run swiftly
|
||||
Fast,
|
||||
/// Crawl slowly but steadily
|
||||
///
|
||||
/// This paragraph is ignored because there is no long help text for possible values.
|
||||
Slow,
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue