From e05ece76963f322a5de46bab4b083efb55b24379 Mon Sep 17 00:00:00 2001 From: Kevin K Date: Sun, 15 Mar 2015 17:39:36 -0400 Subject: [PATCH] Fixed doc tests --- Cargo.toml | 2 +- src/argmatches.rs | 6 +++--- src/subcommand.rs | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index e1fa63e4..7cb85cb6 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "clap" -version = "0.4.0" +version = "0.4.1" authors = ["Kevin K. "] exclude = ["docs/*"] description = "A Command Line Argument Parser written in Rust" diff --git a/src/argmatches.rs b/src/argmatches.rs index 2fff428a..f154a398 100644 --- a/src/argmatches.rs +++ b/src/argmatches.rs @@ -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... diff --git a/src/subcommand.rs b/src/subcommand.rs index e5ec47cb..ffbb798a 100644 --- a/src/subcommand.rs +++ b/src/subcommand.rs @@ -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")