mirror of
https://github.com/clap-rs/clap
synced 2024-12-14 06:42:33 +00:00
commit
6ec80662d3
1 changed files with 4 additions and 2 deletions
|
@ -571,11 +571,13 @@ pub enum AppSettings {
|
||||||
/// ```
|
/// ```
|
||||||
/// Now doing the same thing, but *not* using any subcommands will result in the value not being
|
/// Now doing the same thing, but *not* using any subcommands will result in the value not being
|
||||||
/// propagated down.
|
/// propagated down.
|
||||||
|
///
|
||||||
/// ```rust
|
/// ```rust
|
||||||
/// # use clap::{App, Arg, AppSettings};
|
/// # use clap::{App, Arg, AppSettings, SubCommand};
|
||||||
/// let m = App::new("myprog")
|
/// let m = App::new("myprog")
|
||||||
/// .setting(AppSettings::PropagateGlobalValuesDown)
|
/// .setting(AppSettings::PropagateGlobalValuesDown)
|
||||||
/// .global_arg(Arg::from_usage("<cmd> 'command to run'"))
|
/// .arg(Arg::from_usage("[cmd] 'command to run'")
|
||||||
|
/// .global(true))
|
||||||
/// .subcommand(SubCommand::with_name("foo"))
|
/// .subcommand(SubCommand::with_name("foo"))
|
||||||
/// .get_matches_from(vec!["myprog", "set"]);
|
/// .get_matches_from(vec!["myprog", "set"]);
|
||||||
///
|
///
|
||||||
|
|
Loading…
Reference in a new issue