External subcommands are now supported via the following:
```rust
extern crate clap;
use clap::{App, AppSettings};
fn main() {
// Assume there is a third party subcommand named myprog-subcmd
let m = App::new("myprog")
.setting(AppSettings::AllowExternalSubcommands)
.get_matches_from(vec![
"myprog", "subcmd", "--option", "value", "-fff", "--flag"
]);
// All trailing arguments will be stored under the subcommands sub-matches under a
// value of their runtime name (in this case "subcmd")
match m.subcommand() {
(external, Some(ext_m)) => {
let ext_args: Vec<&str> = ext_m.values_of(external).unwrap().collect();
assert_eq!(ext_args ,["--option", "value", "-fff", "--flag"]);
},
_ => unreachable!()
}
}
```
Closes#372
By using AppSettings::AllowLeadingHyphen values starting with a
leading hyphen (such as a negative number) are supported. This
setting should be used with caution as it silences certain
circumstances which would otherwise be an error (like forgetting
a value to an option argument).
Closes#385
This commit adds support for values separated by commas such as
--option=val1,val2,val3. It also includes support for uses
without the equals and shorts (both with and without)
--option=val1,val2
--option val1,val2
-oval1,val2
-o=val1,val2
-o val1,val2
Closes#348
chore: bump dependencies bitflags and yaml-rust to latest version
Bump `bitflags` from 0.3.3 to 0.4.0 and `yaml-rust` from 0.2.2 to 0.3.0.
All tests pass in current stable, beta and nightly (`1.8.0-nightly (38e23e8f7 2016-01-27)`).
docs(README.md): fix typo and make documentation conspicuous
Well, I thought scrolling through half page of readme to find link to documentation was counterintuitive.
And, of course, 10,000 ns is 10 ms.
Scopewide attributes
For `tests/yaml.rs`, it makes sense to use scope wide attribute, which applies to the whole file, because yaml test will not be tested without yaml feature.
For `examples/17_yaml.rs`, I moved the `use` statement inside so that seemingly random unused import warning doesn't pop up.
For `tests/unicode.rs`, well, I tried fiddling around with unicode with Windows without much success...