Commit graph

38 commits

Author SHA1 Message Date
Erick Tryzelaar
cacc23473c Remove v2 depecated features.
This patch:

* Removes the `ArgSettings::Global` variant, and replaces all
  users of it to `Arg::global(...)`. The variant itself is lifted up
  into a field on Arg. This was deprecated in clap 2.32.0.
* Removes AppFlags::PropagateGlobalValuesDown. This was deprecated in
  clap 2.27.0.
* Removes `Arg::empty_values`. This was deprecated in clap 2.30.0.
* Removes `ArgMatches::usage`. This was deprecated in clap 2.32.0.
2019-06-19 17:04:29 -07:00
Kevin K
573b0a9e88
chore: upgrades to 2018 edition of Rust 2019-04-05 20:21:30 -04:00
Kevin K
f0d6278685
refactor: fixes benches to the new fewer required lifetime parameter 2019-04-05 20:21:27 -04:00
Kevin K
20c72525d2 style: cargo fmt run 2018-11-14 12:05:06 -05:00
Kevin K
f6ce7d5cc2
refactor: makes benches compile on v3 2018-11-13 22:16:02 -05:00
Kevin K
0de9e07412
Merge branch 'v3-master' into map 2018-11-13 22:07:16 -05:00
Kevin K
03333800fe refactor: remove code going to other crates and deprecations 2018-10-19 23:31:06 -04:00
Alena Yuryeva
5fa48a678d Fixed ripgrep benches 2018-09-01 20:51:49 +03:00
Alena Yuryeva
1216cddb63 Fixed help benchmark 2018-09-01 20:42:31 +03:00
Kevin K
eaa0700e7e
style: rustfmt run 2018-08-01 23:13:51 -04:00
Kevin K
94872e00a5
refactor(Arg): changes Arg::short to accept a char instead of &str
Closes #1303
2018-07-23 15:10:12 -04:00
Mikael Zayenz Lagerkvist
d83debd745 fix(benches): Fix compilation error 2018-05-29 18:24:40 +02:00
Corentin Henry
4f602b7e86 replace Arg::from_usage by Arg::from 2018-04-21 11:59:19 -07:00
Kevin K
41572e4d2d
benches: partially updates the benches to new arg.setting calls 2018-02-03 15:06:58 -05:00
Kevin K
4c54c2a696
tests: silence some warnings 2018-01-25 23:03:13 -05:00
Kevin K
1ab10275e4
style: rustfmt run 2018-01-25 12:21:17 -05:00
Kevin K
d26ab2b97c fix: fixes the ripgrep benchmark by adding a value to a flag that expects it 2018-01-09 10:53:20 -05:00
Igor Gnatenko
bfcf5dd076 use .bash as extension for bash completions
* bash-completions have code to use only `foo`, `foo.bash` and `_foo`
files for completion
* /usr is proper place for system-wide stuff rather than /etc

Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
2017-11-23 18:48:36 +01:00
Martin Geisler
918283d645 tests: benchmark building ripgrep help text
The ripgrep benchmarks work with lots of options and have really long
help texts. This makes them a good fit for judging the overall time it
takes to construct and format the help text.
2017-05-29 17:02:57 -04: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
a822ad8c27
tests: adds a bench for rustups subcommand parsing 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
9c3cb9834c
bench: adds a bench with short circuiting some calls via ArgsNegateSubcommands 2017-01-02 14:38:17 -05: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
Hernan Grecco
627ae38dc0 refactor(HELP): Removed code for old help system and tests that helped with the transitions 2016-04-13 07:21:21 -03:00
Hernan Grecco
81e121edd6 feat(HELP): Add a Templated Help system.
The strategy is to copy the template from the the reader to wrapped stream
until a tag is found. Depending on its value, the appropriate content is copied
to the wrapped stream.
The copy from template is then resumed, repeating this sequence until reading
the complete template.

Tags arg given inside curly brackets:
Valid tags are:
    * `{bin}`         - Binary name.
    * `{version}`     - Version number.
    * `{author}`      - Author information.
    * `{usage}`       - Automatically generated or given usage string.
    * `{all-args}`    - Help for all arguments (options, flags, positionals arguments,
                        and subcommands) including titles.
    * `{unified}`     - Unified help for options and flags.
    * `{flags}`       - Help for flags.
    * `{options}`     - Help for options.
    * `{positionals}` - Help for positionals arguments.
    * `{subcommands}` - Help for subcommands.
    * `{after-help}`  - Help for flags.
2016-04-13 07:06:23 -03:00
Hernan Grecco
04b5b074d1 refactor(HELP): A new Help Engine
The largest organizational change is that methods used to generate the help are
implemented by the Help object and not the App, FlagBuilder, Parser, etc.

The new code is based heavily on the old one with a few minor modifications
aimed to reduce code duplication and coupling between the Help and the rest
of the code.

The new code turn things around: instead of having a HelpWriter that holds an
AnyArg object and a method that is called with a writer as argument,
there is a Help Object that holds a writer and a method that is called with a
writer as an argument.

There are still things to do such as moving `create_usage` outside the Parser.

The peformance has been affected, probably by the use of Trait Objects. This
was done as a way to reduce code duplication (i.e. in the unified help code).
This performance hit should not affect the usability as generating and printing
the help is dominated by user interaction and IO.

The old code to generate the help is still functional and is the active one.
The new code has been tested against the old one by generating help strings
for most of the examples in the repo.
2016-04-13 07:06:23 -03:00
Kevin K
60a61ddde6 tests(Benches): fixes failing bench marks 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
8988853fb8 imp(ArgMatcher): huge refactor and deduplication of code
Tons of code has been moved into functions, deduplicated, made much
easier to read, maintain, and understand. Comments still need to be
added, but that will happen shortly. Modules have also been moved around
to follow Rust conventions and best practices.

All functionality remains exactly the same
2015-11-11 10:26:05 -05:00
James McGlashan
13712da1d3 fix: Macro benchmarks 2015-09-10 22:23:58 +10:00
Kevin K
87f3a47eaa tests: adds benches for builder vs from_usage 2015-09-09 22:15:25 -04:00
SungRim Huh
f93dab93e0 tests(benchmark): add more benchmarks 2015-09-01 11:00:51 -05:00
SungRim Huh
866279aaaa tests(benchmark): Add benchmarks
single flag, option, positional, and complex arguments with and without subcommand.
2015-08-30 13:46:53 -05:00
SungRim Huh
80a05926bf tests(benchmark): Move repeating code to macro 2015-08-30 13:14:42 -05:00
SungRim Huh
53671cf66b tests(benchmark): Add build and clean parse benchmarks 2015-08-29 23:03:11 -05:00