mirror of
https://github.com/clap-rs/clap
synced 2024-12-13 14:22:34 +00:00
Fixed doc tests
This commit is contained in:
parent
65a8a4f045
commit
e05ece7696
3 changed files with 5 additions and 5 deletions
|
@ -1,7 +1,7 @@
|
|||
[package]
|
||||
|
||||
name = "clap"
|
||||
version = "0.4.0"
|
||||
version = "0.4.1"
|
||||
authors = ["Kevin K. <kbknapp@gmail.com>"]
|
||||
exclude = ["docs/*"]
|
||||
description = "A Command Line Argument Parser written in Rust"
|
||||
|
|
|
@ -172,7 +172,7 @@ impl ArgMatches {
|
|||
///
|
||||
/// ```no_run
|
||||
/// # use clap::{App, Arg, SubCommand};
|
||||
/// # let matches = App::new("myapp").subcommand(SubCommand::new("test")).get_matches();
|
||||
/// # let app_matches = App::new("myapp").subcommand(SubCommand::new("test")).get_matches();
|
||||
/// if let Some(matches) = app_matches.subcommand_matches("test") {
|
||||
/// // Use matches as normal
|
||||
/// }
|
||||
|
@ -192,8 +192,8 @@ impl ArgMatches {
|
|||
///
|
||||
/// ```no_run
|
||||
/// # use clap::{App, Arg, SubCommand};
|
||||
/// # let matches = App::new("myapp").subcommand(SubCommand::new("test")).get_matches();
|
||||
/// match app_matches.subcommand_() {
|
||||
/// # let app_matches = App::new("myapp").subcommand(SubCommand::new("test")).get_matches();
|
||||
/// match app_matches.subcommand_name() {
|
||||
/// Some("test") => {}, // test was used
|
||||
/// Some("config") => {}, // config was used
|
||||
/// _ => {}, // Either no subcommand or one not tested for...
|
||||
|
|
|
@ -13,7 +13,7 @@ use argmatches::ArgMatches;
|
|||
/// ```no_run
|
||||
/// # use clap::{App, Arg, SubCommand};
|
||||
/// # let matches = App::new("myprog")
|
||||
/// # .SubCommand(
|
||||
/// # .subcommand(
|
||||
/// SubCommand::new("conifg")
|
||||
/// .about("Used for configuration")
|
||||
/// .arg(Arg::new("config_file")
|
||||
|
|
Loading…
Reference in a new issue