Kevin K
f9668297a4
api(Arg::last): adds the ability to mark a positional argument as 'last' which means it should be used with --
syntax and can be accessed early
...
Marking a positional argument `.last(true)` will allow accessing this argument earlier if the `--` syntax is used (i.e. skipping other positional args)
and also change the usage string to one of the following:
* `$ prog [arg1] [-- <last_arg>]`
* `$ prog [arg1] -- <last_arg>` (if the arg marked `.last(true)` is also marked `.required(true)`)
Closes #888
2017-03-11 12:14:54 -05:00
Kevin K
989862d2cb
chore: fixes small rebase regression
2017-03-10 15:27:24 -05:00
Kevin K
e802a472de
docs(CHANGELOG.md): adds the details about ability to change the help message for the auto-generated help/version
2017-03-10 08:29:57 -05:00
Kevin K
9d4535e1c3
chore: clippy run
2017-03-10 08:24:30 -05:00
Kevin K
075036c28d
fix: fixes a regression 1.11.0 feature
2017-03-10 08:24:30 -05:00
Kevin K
1e4cce0291
tests: corrects the debug messages from the usage module
2017-03-10 08:24:30 -05:00
Kevin K
d2b4c2c61b
fix: fixes false positive clean parse when the suggestions feature is disabled and InferSubcommands is enabled
2017-03-10 08:24:30 -05:00
Kevin K
b841f3743f
fix: fixes a failing build with no-default-features
2017-03-10 08:24:30 -05:00
Kevin K
5c76350f77
tests: fixes failing hidden args test
2017-03-10 08:24:30 -05:00
Kevin K
d484da0d28
fix: fixes a misspelled import for Windows
2017-03-10 08:24:29 -05:00
Kevin K
06e07ad8e6
docs(README.md): removes the old updates from previous versions as it's getting very long and hard to read
2017-03-10 08:24:29 -05:00
Kevin K
a2e31b27b0
chore: increase version
2017-03-10 08:24:29 -05:00
Kevin K
33eb5a6db0
tests: fixes failing dual usage string help test
2017-03-10 08:24:29 -05:00
Kevin K
622b609c57
refactor: moves usage string generation code into it's own module
2017-03-10 08:24:29 -05:00
Kevin K
44ed8b663c
refactor: moves validation code into it's own module
2017-03-10 08:24:29 -05:00
Kevin K
642db9b042
tests: adds tests for new dual usage strings with certain subcommand settings
2017-03-10 08:24:29 -05:00
Kevin K
c8ab24bafa
imp: when AppSettings::SubcommandsNegateReqs and ArgsNegateSubcommands are used, a new more accurate double line usage string is shown
...
Closes #871
2017-03-10 08:24:29 -05:00
Kevin K
d63d404e5e
fix: doesn't print the argument sections in the help message if all args in that section are hidden
2017-03-10 08:24:28 -05:00
Kevin K
539ad6073f
fix: doesn't include the various [ARGS] [FLAGS] or [OPTIONS] if the only ones available are hidden
...
Closes #882
2017-03-10 08:24:28 -05:00
Kevin K
97e8db23b3
fix: now correctly shows subcommand as required in the usage string when AppSettings::SubcommandRequiredElseHelp is used
...
Close #883
2017-03-10 08:24:28 -05:00
Kevin K
91d8280322
chore: rustfmt run
2017-03-10 08:24:28 -05:00
Kevin K
6b58efa330
tests: adds some minor benches for adding args by ref or moving
2017-03-10 08:24:28 -05:00
Kevin K
6f638a53c1
perf: doesn't run arg_post_processing on multiple values anymore
2017-03-10 08:24:28 -05:00
Kevin K
150756b989
setting(InferSubcommands): adds a setting to allow one to infer shortened subcommands or aliases (i.e. for subcommmand "test", "t", "te", or "tes" would be allowed assuming no other ambiguities)
...
Closes #863
2017-03-10 08:22:31 -05:00
Joost Yervante Damad
8adf353e0b
fix(help): don't show ARGS when there are only hidden positional args
...
Also no need to check for Hidden inside for that already is filtered
on !Hidden.
Closes #882
2017-03-10 08:22:31 -05:00
Kevin K
432837624c
chore: tags release beta
2017-03-10 08:22:31 -05:00
Kevin K
24e3839220
perf: changes internal use of VecMap to Vec for matched values of Args
...
This makes a very big difference for CLIs that parse a large number of
values (think ripgrep over a large directory).
This commit improved the ripgrep parsing of ~2,000 values, simulating
giving ripgrep a bunch of files. Parsing when from ~1,200,000 ns to
~400,000 ns! This was conducted a i7-5600U 2.6GHz
2017-03-10 08:22:31 -05:00
Homu
0e1e6dced6
Auto merge of #894 - porglezomp:feature/customize-version-help, r=kbknapp
...
Allow customizing the --version and --help messages
Fixes #889
This currently doesn't support customizing them from YAML, so it still needs some work.
2017-03-10 22:21:51 +09:00
Caleb Jones
c5dac3fa43
Support loading help_message and version_message from the YAML
2017-03-10 01:54:50 -05:00
Caleb Jones
389c413b70
Allow customizing the --version and --help messages
2017-03-10 01:01:56 -05:00
Homu
cb5c9f7930
Auto merge of #886 - nox:die-libc-die, r=kbknapp
...
Remove direct dependency on libc
It's not actually used anymore anywhere.
2017-03-10 07:35:30 +09:00
Anthony Ramine
f4939ad560
Remove direct dependency on libc
...
It's not actually used anymore anywhere.
2017-03-05 19:44:16 +01:00
Homu
7b08a0a583
Auto merge of #879 - kbknapp:perf-imp, r=kbknapp
...
Perf imp
2017-03-01 01:49:16 +09:00
Kevin K
ceec86d3bd
tests: fixes lifetime issue in a test
2017-02-28 08:46:21 -05:00
Kevin K
5471b67121
chore: updates version to next release num
2017-02-28 08:30:14 -05:00
Kevin K
a822ad8c27
tests: adds a bench for rustups subcommand parsing
2017-02-28 08:30:14 -05:00
Kevin K
8da0303bc0
perf: vastly reduces the amount of cloning when adding non-global args minus when they're added from App::args which is forced to clone
2017-02-28 08:30:14 -05:00
Kevin K
677f323bce
tests: adds tests to ensure borrowed args don't break
2017-02-28 08:30:14 -05:00
Kevin K
0a922e5f61
tests: adds parsing cases to ripgrep bench
2017-02-28 08:30:14 -05:00
Kevin K
85a636d539
tests(Benches): adds real world benchmarks
2017-02-28 08:30:13 -05:00
Kevin K
0efa411963
perf: refactor to remove unneeded vectors and allocations and checks for significant performance increases
...
Building an `App` struct with a fair number of args/flags/switches, etc. (used ripgrep as test case)
went from taking ~21,000 ns to ~13,000ns.
2017-02-28 08:30:13 -05:00
Kevin K
b55cae5fdb
refactor: removes unused fields and moves some bools to bitfields
2017-02-28 08:30:09 -05:00
Homu
b336bdbbda
Auto merge of #880 - frewsxcv:vec-map, r=kbknapp
...
Bump vec_map.
None
2017-02-28 22:26:58 +09:00
Corey Farwell
242020330d
Bump vec_map.
2017-02-28 00:05:53 -05:00
Kevin K
10c1d1bd3e
Merge branch 'master' of github.com:kbknapp/clap-rs
2017-02-27 00:37:43 -05:00
Corey Farwell
5ee2665e7a
Implement ExactSizeIterator
for Values
. ( #877 )
2017-02-26 23:20:52 -05:00
Igor Gnatenko
40052bdc0c
switch to regex 0.2 ( #876 )
...
Signed-off-by: Igor Gnatenko <ignatenko@redhat.com>
2017-02-26 22:37:03 -05:00
Homu
389658d945
Auto merge of #875 - ignatenkobrain:patch-1, r=kbknapp
...
Cargo.toml: bump bitflags
2017-02-27 10:07:51 +09:00
Igor Gnatenko
d19d56e635
Cargo.toml: bump bitflags
2017-02-25 23:57:14 +01:00
Homu
6ec80662d3
Auto merge of #872 - kbknapp:patch-1b, r=kbknapp
...
Patch 1b
2017-02-23 12:00:38 +09:00