Commit graph

2320 commits

Author SHA1 Message Date
Kevin K
97fd3f1328
tests: partially updates tests to new arg.setting calls 2018-02-03 15:06:58 -05:00
Kevin K
41572e4d2d
benches: partially updates the benches to new arg.setting calls 2018-02-03 15:06:58 -05:00
Kevin K
2b39054437
chore(v3_changes.md): adds a document to track changes to announce for v3 2018-02-03 15:06:58 -05:00
Kevin K
41436d3b7d
docs(Arg.rs): updates documentation for the deprecations 2018-02-03 15:06:56 -05:00
Kevin K
6fc70d825c
depr(Arg.rs): adds deprecations in prep for v3
A full list of deprecations is:

* Arg::last -> ArgSettings::Last
* Arg::required -> ArgSettings::Required
* Arg::require_equals -> ArgSettings::RequireEquals
* Arg::allow_hyphen_values -> ArgSettings::AllowHyphenValues
* Arg::takes_value -> ArgSettings::TakesValue
* Arg::hide_possible_values -> ArgSettings::HidePossibleValues
* Arg::hide_default_value -> ArgSettings::HideDefaultValue
* Arg::multiple -> ArgSettings::Multiple (see Arg::multiple split)
* Arg::multiple -> ArgSettings::MultipleValues (see Arg::multiple split)
* Arg::multiple -> ArgSettings::MultipleOccurrences (see Arg::multiple split)
* Arg::global -> ArgSettings::Global
* Arg::empty_values -> ArgSettings::AllowEmptyValues
* Arg::hidden -> ArgSettings::Hidden
* Arg::case_insensitive -> ArgSettings::IgnoreCase
* Arg::use_delimiter -> ArgSettings::UseDelimiter
* Arg::require_delimiter -> ArgSettings::RequireDelimiter
* Arg::hide_env_values -> ArgSettings::HideEnvValues
* Arg::next_line_help -> ArgSettings::NextLineHelp
* Arg::set -> Arg::unset_setting (consistent naming with App)
* Arg::unset -> Arg::setting (consistent naming with App)

Relates to #1037
2018-02-03 15:00:55 -05:00
Kevin K
e1f1b474a3
Merge pull request #1156 from kbknapp/v3-dev
V3 dev
2018-01-30 21:14:17 -05:00
Kevin K
04b7532bcb
docs(App.rs): updates the docs away from deprecated methods 2018-01-30 21:10:35 -05:00
Kevin K
c441467de3
depr(App.rs): deprecates old App methods in prep for v3
A full list of deprecations is:

* App::version_message -> App::mut_arg
* App::version_short -> App::mut_arg
* App::help_message -> App::mut_arg
* App::help_short -> App::mut_arg
* App::from_yaml -> serde
* App::usage -> App::override_usage (+no longer assumes leading \t)
* App::help -> App::override_help
* App::template -> App::help_template
* App::args_from_usage -> App::args(&str)
* App::arg_from_usage -> App::arg(Arg::from)
* App::write_help -> &self -> &mut self (#808)
* App::gen_completions -> clap_completions::generate
* App::gen_completions_to -> clap_completions::generate_to
* App::get_matches_safe -> App::try_get_matches (#950 Lib Blitz naming
consistency)
* App::get_matches_from_safe -> App::try_get_matches_from (#950 Lib Blitz
naming consistency)
* App::get_matches_safe_borrow -> App::try_get_matches_from_mut (#950 Lib
Blitz naming consistency)
2018-01-30 21:04:19 -05:00
Kevin K
7372359c9c
Merge pull request #1154 from kbknapp/v3-prep
v3 Prep
2018-01-25 23:15:17 -05:00
Kevin K
4c54c2a696
tests: silence some warnings 2018-01-25 23:03:13 -05:00
Kevin K
1fa4afa45d
tests: continues to update tests to take advantage of new internals 2018-01-25 22:54:05 -05:00
Kevin K
90c0698aff
tests(Bash Completions): fixes the order of several completion commands 2018-01-25 22:36:20 -05:00
Kevin K
78090e5529
tests: removes some instances of println in the tests 2018-01-25 22:36:20 -05:00
Kevin K
7788ef70d9
wip: continuing to iron out the bugs from the internal refactor 2018-01-25 22:36:20 -05:00
Kevin K
712333be98
tests: splits tests into single duties 2018-01-25 15:08:57 -05:00
Kevin K
7673dfc085
perf: refactors the POSIX override handling to lazy handling
This commit primarily changes to a lazy handling of POSIX overrides by
relying on github.com/bluss/ordermap instead of the old HashMap impl.
The ordermap allows us to keep track of which arguments arrived first,
and therefore determine which ones should be removed when an override
conflict is found.

This has the added benefit of we no longer have to do the bookkeeping to
keep track and override args as they come in, we can do it once at the
end.

Finally, ordermap allows fast Vec like iteration of the keys, which we
end up doing several times. Benching is still TBD once the v3 prep is
done, but this change should have a meaningful impact.
2018-01-25 15:08:57 -05:00
Kevin K
e890b647f3
wip: still setting the stage for v3 2018-01-25 12:29:36 -05:00
Kevin K
1ab10275e4
style: rustfmt run 2018-01-25 12:21:17 -05:00
Kevin K
f66e4f3266
chore: removes no longer used style lints 2018-01-25 12:20:58 -05:00
Kevin K
efb3b28ae8
tests: updates the tests that were using clap internals 2018-01-25 12:20:56 -05:00
Kevin K
6705195449
wip: setting the stage for serde, custom derive, and v3 2018-01-25 12:20:04 -05:00
Kevin K
8173d717b1
chore: adds some just recipies for showing errors and tracking todos 2018-01-25 12:20:03 -05:00
Kevin K
4f3231a51c fix(Help): fixes an issue where help is not properly written using App::write_help
Contains a *MINOR* breaking change. App::write_help now requires `&mut self` instead of `&self`.

This fixes a major bug where the help message is entirely incorrect.
More can be found at https://github.com/kbknapp/clap-rs/issues/808

I've decided to make this change because it was preventing further progress.

Anyone's code who breaks the fix is trivial:

```rust
// OLD BROKEN
let app = App::new("broken");
let mut out = io::stdout();
app.write_help(&mut out).expect("failed to write to stdout");

// NEW FIX
let mut app = App::new("broken");  // <-- let mut
let mut out = io::stdout();
app.write_help(&mut out).expect("failed to write to stdout");
```

Closes #808
2018-01-24 11:34:14 -05:00
Kevin K
acdbd47152 wip: changes to builders in prep for v3 2018-01-24 11:34:14 -05:00
Kevin K
969c3adb41
Merge pull request #1136 from willmurphyscode/issue-1135
Test for Issue 1135
2018-01-22 14:08:50 -05:00
Kevin K
f27d35daa8
Merge pull request #1153 from ignatenkobrain/strsim-0.7
deps: update strsim to 0.7
2018-01-22 14:08:16 -05:00
Kevin K
d03d13399f
Merge branch 'master' into issue-1135 2018-01-20 15:27:58 -05:00
Kevin K
2a933d1291
Merge branch 'master' into strsim-0.7 2018-01-20 15:26:52 -05:00
Kevin K
95041ff10f
Merge pull request #1151 from discosultan/patch-1
Fix typos
2018-01-20 15:26:13 -05:00
Igor Gnatenko
836e98084c
deps: update strsim to 0.7
Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
2018-01-19 09:39:49 +01:00
Will Murphy
4896e817be clean up comments 2018-01-18 20:45:31 -05:00
Will Murphy
c759d2027b clean up comments in tests; add error case test 2018-01-18 20:41:23 -05:00
Will Murphy
74976a0df9 Implement required_unless for flag
Flags were incorrectly reporting that they never had required_unless args.
2018-01-18 20:34:22 -05:00
Will Murphy
c6c9d9b33f Merge branch 'master' into issue-1135 2018-01-18 20:32:44 -05:00
Kevin K
6e66eac2ff
Merge branch 'master' into patch-1 2018-01-18 15:07:17 -05:00
Kevin K
f85fd9fbc8
Merge pull request #1152 from kbknapp/html_doc_root
chore: fix html_doc_root
2018-01-18 15:07:04 -05:00
Kevin K
5bb926ebf9 chore: fix html_doc_root 2018-01-18 15:06:23 -05:00
discosultan
61cf3f9142 Fix typo in arg.rs 2018-01-18 15:46:20 +01:00
discosultan
67e937acf7 Fix typo in 07_option_args.rs 2018-01-18 14:21:02 +01:00
discosultan
8aa3c57351 Fix typo in 07_option_args.rs 2018-01-18 14:16:15 +01:00
Jaanus Varus
354cefd274
Fix typos in 03_args.rs 2018-01-18 13:20:02 +01:00
Kevin K
b6f36f55a0
Merge pull request #1150 from kbknapp/v2.29.2
chore: increase version
2018-01-16 15:03:01 -05:00
Kevin K
df996822c8 chore: increase version 2018-01-16 15:01:53 -05:00
Kevin K
04d97c4cc7
Merge pull request #1149 from discosultan/patch-1
Fix doc typo in 14_groups.rs
2018-01-16 14:56:45 -05:00
Kevin K
288a777eca
Merge branch 'master' into patch-1 2018-01-16 14:56:34 -05:00
Kevin K
cfb94706d1
Merge pull request #1147 from segevfiner/zsh-completion-improvements
Zsh completion improvements
2018-01-16 14:56:14 -05:00
Jaanus Varus
eb9269a23b
Fix doc typo in 14_groups.rs 2018-01-16 19:54:14 +01:00
Kevin K
fc8cf97b94
Merge branch 'master' into zsh-completion-improvements 2018-01-16 00:23:34 -05:00
Kevin K
ff22cd98ba
Merge pull request #1148 from kbknapp/add-messense
chore(SPONSORS.md): adds the latest sponsor! Yay
2018-01-15 23:31:09 -05:00
Kevin K
0abcb80694
chore(SPONSORS.md): adds the latest sponsor! Yay 2018-01-15 23:29:55 -05:00