mirror of
https://github.com/clap-rs/clap
synced 2024-11-11 07:14:15 +00:00
docs(examples): Highlight possible-values in help
Instead of showing the user how to do things manually, let's make the contrast in `--help` more obvious by not manually listing the possible values.
This commit is contained in:
parent
6fc9c7cff4
commit
1f0d86a407
1 changed files with 2 additions and 8 deletions
|
@ -11,20 +11,14 @@ fn main() {
|
|||
.about("does awesome things")
|
||||
.arg(
|
||||
Arg::new("INPUT")
|
||||
.about("The input file to use") // Note, we don't need to specify
|
||||
// anything like, "Defaults to..."
|
||||
// because clap will automatically
|
||||
// generate that for us, and place
|
||||
// it in the help text
|
||||
.about("The input file to use")
|
||||
.default_value("input.txt")
|
||||
.index(1),
|
||||
)
|
||||
// Next we'll use the Option::unwrap_or method on this "CONFIG" option
|
||||
.arg(
|
||||
Arg::new("CONFIG")
|
||||
// Note that we have to manually include some verbage to the user
|
||||
// telling them what the default will be.
|
||||
.about("The config file to use (default is \"config.json\")")
|
||||
.about("The config file to use")
|
||||
.short('c')
|
||||
.takes_value(true),
|
||||
)
|
||||
|
|
Loading…
Reference in a new issue