Commit graph

3419 commits

Author SHA1 Message Date
Kevin K
693aece2cb fix: fixes yaml build for 2x base 2016-01-28 11:45:31 -05:00
Kevin K
4c37b26a84 tests: fixes some failing doc tests 2016-01-28 11:45:31 -05:00
Kevin K
e494672ffc refactor: removes some unnecessary code checks 2016-01-28 11:45:31 -05:00
Kevin K
f1876388a7 docs: updating docs for 2x release 2016-01-28 11:45:31 -05:00
Kevin K
609c06e119 feat: adds support for external subcommands
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
2016-01-28 11:45:31 -05:00
Kevin K
86f3e33975 refactor(macros): uses macros to implement Settings enums 2016-01-28 11:45:31 -05:00
Kevin K
26ecadd252 feat: adds support values with a leading hyphen
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
2016-01-28 11:45:31 -05:00
Kevin K
474f27af43 tests: adds tests for values when delims have been turned off 2016-01-28 11:45:31 -05:00
Kevin K
35ad17a282 feat: adds support for turning off the value delimiter
Closes #352
2016-01-28 11:45:31 -05:00
Kevin K
7b0ff38fe7 tests: adds tests for different value delimiters 2016-01-28 11:45:31 -05:00
Kevin K
0871145245 feat: adds support changing the value delimiter
Closes #353
2016-01-28 11:45:31 -05:00
Kevin K
28041cdad9 tests: adds tests for comma separated values 2016-01-28 11:45:31 -05:00
Kevin K
c2e03a0a4e feat: adds support for comma separated values
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
2016-01-28 11:45:31 -05:00
Kevin K
60a61ddde6 tests(Benches): fixes failing bench marks 2016-01-28 11:45:31 -05:00
Kevin K
4192e1acea test(Yaml): fixes yaml tests 2016-01-28 11:45:31 -05:00
Kevin K
f17e150894 tests(Usage Parser): adds and fixes tests for usage parser 2016-01-28 11:45:31 -05:00
Kevin K
eb4de9215f imp(From Usage): vastly improves the usage parser
Closes #350
2016-01-28 11:45:31 -05:00
Kevin K
8c5ab033e7 tests: fixes broken python tests for optional values 2016-01-28 11:45:31 -05:00
Kevin K
32dd302f97 tests: fixes tests for optional option values 2016-01-28 11:45:31 -05:00
Kevin K
95e8209712 feat: adds support with options with optional values
Closes #367
2016-01-28 11:45:31 -05:00
Kevin K
0eba835968 tests: updated python tests to v2 info 2016-01-28 11:45:31 -05:00
Kevin K
d707fa0fad tests(v2): updating yaml tests to new v2 base 2016-01-28 11:45:31 -05:00
Kevin K
0410873d8d chore: clippy run 2016-01-28 11:45:31 -05:00
Kevin K
bb52d2d194 chore: removes unneeded function 2016-01-28 11:45:31 -05:00
Kevin K
e874a0d5e0 feat(UTF-8): adds support for invalid utf8 in values
Closes #269
2016-01-28 11:45:31 -05:00
Kevin K
c3e96232c9 tests(v2): fixing more tests on the new v2 base 2016-01-28 11:45:31 -05:00
Kevin K
0031d78564 refactor(v2): improving macros for code dedup 2016-01-28 11:45:31 -05:00
Kevin K
7fc18e685f test(v2): fixing tests to pass under new v2 changes 2016-01-28 11:45:31 -05:00
Kevin K
20de5c6e76 feat(v2): implementing the base of 2.x
This commit implements the base changes for clap 2.x
2016-01-28 11:45:31 -05:00
Kevin K
3d0a39b1b8 chore: adds new contributors 2016-01-28 11:45:31 -05:00
Paul Blouët
53f97805b3 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.
2016-01-28 14:50:27 +01:00
Homu
47fe5770fc Auto merge of #396 - kbknapp:fix-nightly, r=kbknapp
chore: fix failing nightly
2016-01-27 23:34:53 +09:00
Kevin K
d3a4834225 chore: fix failing nightly 2016-01-27 10:09:29 -05:00
Homu
56e2f752ac Auto merge of #382 - sru:tests, r=kbknapp
tests(help): add tests for help subcommand

#166
2016-01-14 22:28:04 -08:00
Sung Rim Huh
44cbed1a2a tests(help): add tests for help subcommand 2016-01-14 20:23:50 -08:00
Homu
113ed0284e Auto merge of #381 - sru:tests, r=sru
Tests

#166

Almost everything from run_tests.py except the suggestion...
2016-01-14 17:11:25 -08:00
Sung Rim Huh
32ef3264b9 tests: add checks for help and version flag 2016-01-13 09:03:27 -08:00
Sung Rim Huh
1c41d1bf43 tests(possible_values): add tests for possible values 2016-01-13 08:52:42 -08:00
Sung Rim Huh
e2c63cded7 tests(multiple_values): add positional multiple values 2016-01-13 08:28:24 -08:00
Sung Rim Huh
346450e6f1 tests(subcommands): add subcommand tests 2016-01-13 08:06:00 -08:00
Homu
34ea46969e Auto merge of #378 - sru:readme-typo, r=kbknapp
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.
2016-01-13 05:16:00 +09:00
Sung Rim Huh
07b9f61495 docs(README.md): fix typo and make documentation conspicuous 2016-01-12 06:59:11 -08:00
Homu
68d43311e0 Auto merge of #377 - sru:scopewide, r=kbknapp
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...
2016-01-12 15:16:55 +09:00
Sung Rim Huh
3936b28035 tests(yaml): use scope wide attribute 2016-01-11 21:13:14 -08:00
Sung Rim Huh
b2d29b0a68 tests(unicode): use scope wide attribute 2016-01-11 21:08:38 -08:00
Homu
b1264b7dbd Auto merge of #375 - messense:messense-patch-1, r=Vinatorul
docs(App) Fix App.print_help documentation
2016-01-10 20:36:19 +09:00
messense
f0a0e4df50 docs(App) Fix App.print_help documentation 2016-01-10 16:44:24 +08:00
Homu
f2a8a86575 Auto merge of #374 - bradurani:patch-2, r=kbknapp
Fixes missing word in README

Fixes sentence with missing word in README.md
2016-01-10 17:24:33 +09:00
Brad Urani
9e08a92860 Fixes missing word in README
Fixes sentence with missing word in README.md
2016-01-08 00:08:38 -08:00
Homu
37006c3352 Auto merge of #371 - kbknapp:v1.5.5, r=kbknapp
chore: increases version
2016-01-04 20:19:10 +09:00