docs(clap): improve readability of examples with App::args_from_usage()

This commit is contained in:
Kevin K 2015-04-13 18:08:25 -04:00
parent 91d2904599
commit 09497c916b
2 changed files with 6 additions and 7 deletions

View file

@ -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")

View file

@ -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"),