From fa26d40a18c177e7048b1cbe19783e95ed9a0747 Mon Sep 17 00:00:00 2001 From: Marco A L Barbosa Date: Wed, 22 Feb 2017 11:25:10 -0300 Subject: [PATCH 1/5] Fix missing line before code block --- src/app/settings.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/app/settings.rs b/src/app/settings.rs index a3f879bf1f0..a6400c1f461 100644 --- a/src/app/settings.rs +++ b/src/app/settings.rs @@ -571,6 +571,7 @@ pub enum AppSettings { /// ``` /// Now doing the same thing, but *not* using any subcommands will result in the value not being /// propagated down. + /// /// ```rust /// # use clap::{App, Arg, AppSettings}; /// let m = App::new("myprog") From 6bf94606c2dc8c64ed3c525d79dc650c2575ba1c Mon Sep 17 00:00:00 2001 From: Kevin K Date: Wed, 22 Feb 2017 16:36:46 -0500 Subject: [PATCH 2/5] test: fixes failing doc test --- src/app/settings.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/app/settings.rs b/src/app/settings.rs index a6400c1f461..ae71a0c1ac5 100644 --- a/src/app/settings.rs +++ b/src/app/settings.rs @@ -573,10 +573,11 @@ pub enum AppSettings { /// propagated down. /// /// ```rust - /// # use clap::{App, Arg, AppSettings}; + /// # use clap::{App, Arg, AppSettings, SubCommand}; /// let m = App::new("myprog") /// .setting(AppSettings::PropagateGlobalValuesDown) - /// .global_arg(Arg::from_usage(" 'command to run'")) + /// .arg(Arg::from_usage("[cmd] 'command to run'") + /// .global(true)) /// .subcommand(SubCommand::with_name("foo")) /// .get_matches_from(vec!["myprog", "set"]); /// From d19d56e63557c170ad99b6f41a675f8ee76d3637 Mon Sep 17 00:00:00 2001 From: Igor Gnatenko Date: Sat, 25 Feb 2017 23:57:14 +0100 Subject: [PATCH 3/5] Cargo.toml: bump bitflags --- Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index c1b9f7b89e8..60229cd91b6 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -16,7 +16,7 @@ A simple to use, efficient, and full featured Command Line Argument Parser """ [dependencies] -bitflags = "0.7.0" +bitflags = "0.8.0" vec_map = "0.6.0" unicode-width = "0.1.4" unicode-segmentation = "1.0.1" From 40052bdc0cf6b019bbd7cb5d8027c678330ae54f Mon Sep 17 00:00:00 2001 From: Igor Gnatenko Date: Mon, 27 Feb 2017 04:37:03 +0100 Subject: [PATCH 4/5] switch to regex 0.2 (#876) Signed-off-by: Igor Gnatenko --- Cargo.toml | 2 +- clap-test.rs | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 60229cd91b6..011ac3fb5dc 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -29,7 +29,7 @@ clippy = { version = "~0.0.112", optional = true } atty = { version = "0.2.2", optional = true } [dev-dependencies] -regex = "~0.1.80" +regex = "0.2" [features] default = ["suggestions", "color", "wrap_help"] diff --git a/clap-test.rs b/clap-test.rs index 918a00e875e..ebbf9ea0e0d 100644 --- a/clap-test.rs +++ b/clap-test.rs @@ -12,8 +12,8 @@ mod test { S2: AsRef { let re = Regex::new("\x1b[^m]*m").unwrap(); // Strip out any mismatching \r character on windows that might sneak in on either side - let left = re.replace_all(&l.as_ref().trim().replace("\r", "")[..], ""); - let right = re.replace_all(&r.as_ref().trim().replace("\r", "")[..], ""); + let left = re.replace_all(&l.as_ref().trim().replace("\r", "")[..], "").into_owned(); + let right = re.replace_all(&r.as_ref().trim().replace("\r", "")[..], "").into_owned(); let b = left == right; if !b { println!(""); @@ -69,4 +69,4 @@ mod test { .arg_from_usage("-o --option [scoption]... 'tests options'") .arg_from_usage("[scpositional] 'tests positionals'")) } -} \ No newline at end of file +} From 5ee2665e7aaf4eee7f0dc51c91c60d1cc62bbd95 Mon Sep 17 00:00:00 2001 From: Corey Farwell Date: Sun, 26 Feb 2017 23:20:52 -0500 Subject: [PATCH 5/5] Implement `ExactSizeIterator` for `Values`. (#877) --- src/args/arg_matches.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/args/arg_matches.rs b/src/args/arg_matches.rs index b20d490d7ec..12364fdc42b 100644 --- a/src/args/arg_matches.rs +++ b/src/args/arg_matches.rs @@ -568,6 +568,8 @@ impl<'a> DoubleEndedIterator for Values<'a> { fn next_back(&mut self) -> Option<&'a str> { self.iter.next_back() } } +impl<'a> ExactSizeIterator for Values<'a> {} + /// An iterator over the key-value pairs of a map. #[derive(Clone)] pub struct Iter<'a, V: 'a> {