mirror of
https://github.com/clap-rs/clap
synced 2024-12-13 06:12:40 +00:00
Merge branch 'master' of github.com:kbknapp/clap-rs
This commit is contained in:
commit
10c1d1bd3e
4 changed files with 11 additions and 7 deletions
|
@ -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"
|
||||
|
@ -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"]
|
||||
|
|
|
@ -12,8 +12,8 @@ mod test {
|
|||
S2: AsRef<str> {
|
||||
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'"))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -571,11 +571,13 @@ 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};
|
||||
/// # use clap::{App, Arg, AppSettings, SubCommand};
|
||||
/// let m = App::new("myprog")
|
||||
/// .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"))
|
||||
/// .get_matches_from(vec!["myprog", "set"]);
|
||||
///
|
||||
|
|
|
@ -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> {
|
||||
|
|
Loading…
Reference in a new issue