Commit graph

1525 commits

Author SHA1 Message Date
nabijaczleweli
2608540940
imp(with_defaults): Deprecate App::with_defaults()
Following the discussion on #638 a consensus that it can never work
(and was a mistake in the first place) has been reached

Closes #638
2016-10-16 21:22:54 +02:00
Homu
47ffccd251 Auto merge of #682 - tormol:ignore_less_doctests, r=kbknapp
Ignore fewer doc-tests
2016-10-17 01:55:10 +09:00
tormol
4ee85b95d2 docs: Improve documentation around features
* Clap has dependencies even with all features disabled.
* The "nightly" feature does nothing, so don't mention it.
* Explain the difference between "unstable" and "nightly" better.
* Split features into groups (default, opt-in, clap-development).
* For contributors: update what tests should be run, and remove make command.
* Removes a repeated word and splits up some long markdown lines.

Also groups features by category and dependencies by feature in Cargo.toml.
2016-10-16 11:31:12 +02:00
tormol
df2c40804d chore(travis): test more feature combinations and remove the "travis" --feature 2016-10-16 11:31:12 +02:00
tormol
835f75e3ba fix(features): Make lints not enable other nightly-requiring features 2016-10-16 11:31:12 +02:00
tormol
86828a5024 chore(debug): fix a single typo in a debug message 2016-10-16 11:31:12 +02:00
tormol
3ccde7a4b8 docs: reword docs for ErrorKind and app::Settings
Also adds a blank line between variants and
wraps markdown lines at punctuation when it makes sense. (Doesn't affect generated docs)
2016-10-16 11:31:12 +02:00
tormol
9f6217a424 docs(ErrorKind): improve some errors about subcommands
* InvalidSubcommand requires feature="suggestions".
* UnknownArgument can also be caused by unrecognized subcommands.
2016-10-16 11:31:12 +02:00
tormol
996fc38176 docs: fix tests that fail when the "suggestions" feature is disabled 2016-10-16 11:31:12 +02:00
tormol
da88fd254b style: only ignore clippy warning if lints are enabled
else you get another warning!
2016-10-16 11:31:12 +02:00
tormol
af9e1a393c docs: fix the OsString-using doc-tests 2016-10-16 11:31:12 +02:00
tormol
4c27f0ade9 tests: run OsString-using doc-tests on unix platforms
Closes #506
2016-10-16 11:31:12 +02:00
tormol
8c0f55516f docs(yaml): make sure the doc-tests don't fail before "missing file"
Removing an unused import is the only visible change.
2016-10-16 11:31:12 +02:00
tormol
0ba9f4b123 docs: tag non-rust code blocks as such instead of ignoring them 2016-10-16 11:31:12 +02:00
tormol
330a376a46 tests: run or compile some currently ignored doc-tests 2016-10-16 11:31:12 +02:00
Homu
e151bfc2e8 Auto merge of #687 - wdv4758h:issue_685, r=kbknapp
fix(Completions): fish completions for nested subcommands

Fix #685
2016-10-16 12:02:53 +09:00
Chiu-Hsiang Hsu
a61eaf8aad fix(Completions): fish completions for nested subcommands 2016-10-15 17:45:58 +08:00
Homu
95bde36353 Auto merge of #681 - tormol:fix_werrnings, r=kbknapp
Fix warnings in code enabled by yaml, !color or !suggestions
2016-10-06 08:01:46 +09:00
tormol
5778871951 style: remove the .ok() in result.ok().expect("...")
clippy doesn't check doc-tests and `include!()`d files,
so there might bee more un-reported lint.
2016-10-05 23:16:22 +02:00
tormol
7f797e68d8 style: fix lints in code that's not compiled if the opt-out feature "color" is set 2016-10-05 23:16:22 +02:00
tormol
102fb7d2ce style: fix lints in yaml-related functions 2016-10-05 23:16:15 +02:00
tormol
215677bfa7 style: remove #[allow("warning that apparently doesn't exist")]
I say "apparently" because it's listed on https://manishearth.github.io/rust-clippy/master/
and not as deprecated.
2016-10-05 23:15:53 +02:00
Homu
3cb747d845 Auto merge of #680 - kbknapp:v2.14.0, r=kbknapp
chore: increase version
2016-10-05 12:16:15 +09:00
Kevin K
bbe457e993 chore: increase version 2016-10-04 21:20:35 -04:00
Homu
42d8aba1a1 Auto merge of #679 - kbknapp:pull-677, r=kbknapp
Fix the behavior of require_delimiter
2016-10-05 08:28:26 +09:00
Hideyuki Tanaka
8cd120c230 Fix the behavior of require_delimiter 2016-10-04 18:40:03 -04:00
Homu
50011f5b8b Auto merge of #678 - nabijaczleweli:master, r=kbknapp
tests(correctness): No longer use App::get_matches() in some places

Use `App::get_matches_from(vec![""])` instead not to fail when flags are passed to the test binary

Closes #676
2016-10-05 06:57:14 +09:00
nabijaczleweli
7b7aa87ddf
tests(correctness): No longer use App::get_matches() in some places
Use App::get_matches_from(vec![""]) instead not to fail when flags are
passed to the test binary

Closes #676
2016-10-04 23:22:43 +02:00
Homu
2472bb2f54 Auto merge of #675 - tormol:fix_werrnings, r=kbknapp
Some refactors / cleanups

I was fixing the clippy errors, but saw afiuna had already fixed them.
This is what's left after I rebased.
2016-10-05 03:07:51 +09:00
tormol
a214a34529 refactor(app::Parser) Replace continue and .push() with iterator adaptors 2016-10-04 19:15:18 +02:00
tormol
9679713a30 refactor(app::Help): Use map.values() and don't do if !foo when there is an else 2016-10-04 19:14:32 +02:00
tormol
7455d73404 refactor(app::Help): Replace str.split('\n') with str.lines() 2016-10-04 19:02:17 +02:00
Homu
4e7466ccce Auto merge of #674 - afiune:afiune/arg-aliases, r=kbknapp
feat(arg_aliases): Ability to alias arguments

There are some cases where you need to have an argument to have an
alias, an example could be when you deprecate one option in favor of
another one.

Now you are going to be able to alias arguments as follows:
```rust
Arg::with_name("opt")
    .long("opt")
    .short("o")
    .takes_value(true)
    .alias("invisible")
    .visible_alias("visible")
```

Closes #669

Also you can alias flags as follow:
```rust
Arg::with_name("flg")
    .long("flag")
    .short("f")
    .alias("not_visible_flag")
    .visible_alias("awesome_v_flag")
```
2016-10-05 01:51:09 +09:00
Salim Afiune
905d3b9777 Fix linting errors from rustc 1.14.0
The new version of rustc 1.14.0-nightly (144af3e97 2016-10-02) has new
linting warnings/errors. This commit fixes them.

Signed-off-by: Salim Afiune <afiune@chef.io>
2016-10-04 12:26:51 -04:00
Salim Afiune
40d6dac973 feat(flag_aliases): Ability to alias flags
Added same alias funtionality for flags, now you can do:
```
Arg::with_name("flg")
    .long("flag")
    .short("f")
    .alias("not_visible_flag")
    .visible_alias("awesome_v_flag")
```

Signed-off-by: Salim Afiune <afiune@chef.io>
2016-10-04 12:26:51 -04:00
Salim Afiune
e5d9760bea Added Arg::(visible_)alias(es) docs
Signed-off-by: Salim Afiune <afiune@chef.io>
2016-10-04 12:26:51 -04:00
Salim Afiune
33b5f6ef2c feat(arg_aliases): Ability to alias arguments
There are some cases where you need to have an argument to have an
alias, an example could be when you depricate one option in favor of
another one.

Now you are going to be able to alias arguments as follows:
```
Arg::with_name("opt")
    .long("opt")
    .short("o")
    .takes_value(true)
    .alias("invisible")
    .visible_alias("visible")
```

Closes #669
2016-10-04 12:26:51 -04:00
Homu
4c0ed77601 Auto merge of #670 - tormol:parse_nonascii_usage, r=kbknapp
Handle non-ascii names / options in from_usage().

Closes #664 and should make it faster too.

Why aren't the stop_at functions written like `c != a && c != b`?
2016-10-05 01:20:19 +09:00
tormol
fd4c0870be refactor(UsageParser tests) Use VecMap's .values() instead of .iter().map(|(_,&v)| v)
In many cases this makes the assert fit on one line, but the double references are a bit awkward.
2016-09-30 17:29:31 +02:00
tormol
42a6d232d4 refactor(UsageParser::parse) merge two ifs 2016-09-30 17:29:31 +02:00
tormol
bb1fa0d694 refactor(UsageParser) Make the functions passed to .stop_at() straightforward 2016-09-30 17:29:31 +02:00
tormol
1d6a7c6e7e fix(UsageParser): Handle non-ascii names / options.
This should also speeds up the parser (except maybe for short options).
Multi-codepoint characters still can't be used as short options, but people shouldn't non-ASCII options nyway.

Closes #664
2016-09-30 17:29:23 +02:00
Homu
5c7a2190cc Auto merge of #668 - nicompte:patch-2, r=kbknapp
docs: typo
2016-09-28 00:33:23 +09:00
Nicolas Barbotte
bac417fa1c docs: typo 2016-09-20 09:47:50 +02:00
Homu
7483cec06c Auto merge of #667 - kbknapp:issues-418,666, r=kbknapp
Issues 418,666
2016-09-19 05:23:23 +09:00
Kevin K
aad171d3e1
chore: increase version 2016-09-18 16:01:27 -04:00
Kevin K
6b9bd215c1
docs(Default Values): adds better examples on using default values
Closes #418
2016-09-18 16:01:27 -04:00
Kevin K
325610eb04
docs: updates README.md with new website information and updated video tutorials info 2016-09-18 16:01:27 -04:00
Kevin K
d12649fd7b
tests: adds tests for value delimiters 2016-09-18 16:01:26 -04:00
Kevin K
c81bc722eb
docs: updates the docs about removing implicit value_delimiter(true) 2016-09-18 15:24:44 -04:00