Commit graph

1637 commits

Author SHA1 Message Date
Kevin K
03d2b2ac80
tests: updates tests to new version of arg.to_string() 2016-10-20 19:39:21 -04:00
Kevin K
a79d0f132c
tests(app/help.rs): adds some additional debugging code, and standardizes a few calls 2016-10-20 19:39:21 -04:00
Kevin K
468baadb83
fix: fixes a bug that made determining when to auto-wrap long help messages inconsistent
Closes #688
2016-10-20 19:39:21 -04:00
Homu
51497a201b Auto merge of #691 - tormol:stabilize_clap_app!, r=kbknapp
Stabilize clap_app!

It was destabilized in 2.0.0 but hasn't been changed since.
Does anyone have changes they want to make, or issues with the current syntax? (I have never used it.)
2016-10-19 02:03:46 +09:00
Kevin K
dc906398fb Merge branch 'master' into stabilize_clap_app! 2016-10-18 10:45:36 -04:00
Homu
c4c6edd7f4 Auto merge of #689 - tormol:fix_werrnings, r=kbknapp
Fix more lints

Why are lints denied when nightly is allowed to fail on travis?
2016-10-18 23:44:55 +09:00
Kevin K
dbe83dfbe7 Merge branch 'master' into fix_werrnings 2016-10-18 10:17:09 -04:00
Homu
c9230c1d52 Auto merge of #692 - nabijaczleweli:imp/638-app-with_defaults-deprecate, r=kbknapp
Deprecate App::with_defaults()

Closes #638
2016-10-17 12:29:06 +09:00
tormol
cd516006e3 imp: Stabilize clap_app!
It was de-stabilized in 2.0.0 but hasn't been changed since.

This commit also updates docs to reflect that the "unstable" feature does nothing now.
2016-10-16 21:33:52 +02:00
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
190aef43fd style: Fix new lints in fish_inner() 2016-10-16 13:05:47 +02:00
tormol
84546f5c7a style: fix one allow()ed lint 2016-10-16 13:04:45 +02:00
tormol
816b0d49c4 style: dis-allow() untriggered lints 2016-10-16 13:04:11 +02: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