mirror of
https://github.com/clap-rs/clap
synced 2024-11-10 06:44:16 +00:00
docs(clap): improve readability of examples with App::args_from_usage()
This commit is contained in:
parent
91d2904599
commit
09497c916b
2 changed files with 6 additions and 7 deletions
|
@ -70,9 +70,9 @@ fn main() {
|
|||
.author("Kevin K. <kbknapp@gmail.com>")
|
||||
.about("Does awesome things")
|
||||
.args_from_usage(
|
||||
"-c --config=[CONFIG] 'Sets a custom config file'
|
||||
<INPUT> 'Sets the input file to use'
|
||||
[debug]... -d 'Sets the level of debugging information'")
|
||||
"-c --config=[CONFIG] 'Sets a custom config file'
|
||||
<INPUT> 'Sets the input file to use'
|
||||
[debug]... -d 'Sets the level of debugging information'")
|
||||
.subcommand(SubCommand::new("test")
|
||||
.about("controls testing features")
|
||||
.version("1.3")
|
||||
|
|
|
@ -3,10 +3,9 @@ extern crate clap;
|
|||
use clap::{App, Arg, SubCommand};
|
||||
|
||||
fn main() {
|
||||
let args =
|
||||
"-f --flag... 'tests flags'
|
||||
-o --option=[opt]... 'tests options'
|
||||
[positional] 'tests positionals'";
|
||||
let args = "-f --flag... 'tests flags'
|
||||
-o --option=[opt]... 'tests options'
|
||||
[positional] 'tests positionals'";
|
||||
// Test version from Cargo.toml
|
||||
let version = format!("{}.{}.{}{}",
|
||||
env!("CARGO_PKG_VERSION_MAJOR"),
|
||||
|
|
Loading…
Reference in a new issue