Commit graph

382 commits

Author SHA1 Message Date
Arjun Kathuria
fe2ef36112 chore: bump the version for textwrap crate from 0.10 to 0.11 2019-03-30 09:11:47 +05:30
Kevin K
9399174416
perf: trims down some macro usage 2018-11-14 21:04:15 -05:00
Kevin K
7accb93f46 chore: removes clippy dep in favor of cargo clippy 2018-11-14 16:06:20 -05:00
Kevin K
95f949efb0 chore: updates strsim dep 2018-11-14 16:06:07 -05:00
Kevin K
2a480451d3 refactor: clippy run 2018-11-14 14:01:48 -05:00
Kevin K
8dd7783cf3 chore: increase version 2018-10-20 21:55:03 -04:00
Kevin K
0f4096b3d4 imp: let users decide on codegen units and LTO 2018-10-19 23:36:22 -04:00
Kevin K
a769639f8b
chore: prepares for the move to clap-rs org 2018-08-01 23:06:12 -04:00
Kevin K
94e0d38c2d
chore: makes clap_derive a git dependency 2018-07-23 15:51:57 -04:00
Kevin K
ab8c97e3f1
chore: relicense under MIT and APACHE 2.0 2018-07-23 14:25:18 -04:00
Kevin K
53b2ca51f4
refactor(Derives): changes the derive traits for the clap_derive crate 2018-07-13 11:36:53 -04:00
Dylan DPC
580ad94df2 fixed typo for coveralls key 2018-06-26 21:19:02 -04:00
Alan K
8a7ac8f543 imp(yaml): Updated yaml-rust to 0.4
Closes #747, #1110
2018-06-22 13:32:13 +02:00
Kevin K
b033bb5abc
chore: ordermap to indexmap 2018-06-12 10:22:18 -04:00
Kevin K
b7e38fb62a
chore: update deps 2018-06-12 10:18:16 -04:00
Kevin K
c010a9d445
chore: removes doc profile 2018-06-12 10:10:03 -04:00
Matthias Krüger
1e3c715c47
Cargo.toml: use codegen-units = 1 in release and bench profiles. 2018-03-19 17:12:02 -04:00
Will Murphy
74421bb8b7 bump version on term size to 1.0.0-beta1 2018-03-06 06:36:59 -05:00
Kevin K
6971624428
imp(Deps): doesnt compile ansi_term on Windows since its not used
Before this commit, ansi_term was compiled anytime the `color` feature
was used. However, on Windows the `color` feature is ignored. Even so
ansi_term was compiled, and just not used. This commit fixes that by
only compiling ansi_term on non-Windows targets. Thanks to @retep998 for
the gudiance.

Closes #1155
2018-02-13 15:43:45 -05:00
Kevin K
e1b10f60aa
chore(Cargo.toml): updates with new excludes to trim package and new badges for crates.io 2018-02-05 16:23:00 -05:00
Kevin K
6a8b301fa4
chore: bumps the Cargo.toml version to 3.0.0-alpha1 to reduce confusion 2018-02-03 15:15:00 -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
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
Kevin K
df996822c8 chore: increase version 2018-01-16 15:01:53 -05:00
Kevin K
92caafaf51 chore: increase version 2018-01-09 11:08:47 -05:00
Kevin K
e962f2cece
chore: increase version 2017-12-02 15:34:02 -05:00
Igor Gnatenko
f74e2dc45f
bump lazy_static to 1 2017-11-30 17:41:34 +01:00
Kevin K
9ef3d82bd0
chore: increase version 2017-11-27 10:28:28 -05:00
Igor Gnatenko
6b98b6ab7d bump version-sync to 0.5 2017-11-22 09:53:33 +01:00
Bastien Orivel
a6593410c1 Update bitflags to 1.0 and bump version 2017-11-21 12:39:12 +01:00
Peter Lyons
ce72aada56 docs: Fix URL path to github hosted files
Closes #1106
2017-11-13 14:03:25 -07:00
Igor Gnatenko
5cfafe4dcd
bump version-sync to 0.4 2017-11-13 18:57:47 +01:00
Igor Gnatenko
851fad43c0 bump ansi_term to 0.10
Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
2017-11-09 17:35:33 +01:00
Kevin K
67170a8bd7
chore: increase version 2017-10-26 10:09:48 -04:00
Kevin K
0246960bdc
chore: adds term_size as an optional dep 2017-10-26 09:40:21 -04:00
Kevin K
e3eaf56b36
chore: increase version 2017-10-24 15:31:33 -07:00
Kevin K
48e0529bcd
chore: clippy run 2017-10-23 23:03:40 -04:00
Árpád Goretity
e1a4cfe3a3 Bump textwrap version as required 2017-10-06 13:53:08 +02:00
Árpád Goretity
ac97edde90 Reorganize optionally depending on term_width 2017-10-06 13:14:01 +02:00
Kevin K
3224e2e1cd Merge pull request #1051 from malbarbo/master
make vec_map optional
2017-10-03 21:49:01 -04:00
Martin Geisler
e09c248fc1 tests: ensure README version numbers are in sync 2017-09-23 12:45:50 +02:00
Marco A L Barbosa
7b2aacde08 make vec_map optional 2017-09-19 15:21:58 -03:00
Kevin K
f093b4c1f8
chore: increase version 2017-09-14 10:39:24 -07:00
Kevin K
cbd813c1a0
chore: increase version 2017-09-13 20:55:00 -07:00
Kevin K
0136e991c4
tests: adds tests for App::long_about 2017-09-13 11:41:49 -07:00
Fraser Hutchison
b3eadb0de5 fix: avoid panic generating default help msg if term width set to 0 due to bug in textwrap 0.7.0
upgrade textwrap to 0.8.0 and add regression test
2017-09-07 00:19:08 +01:00
Kevin K
cd7b40a21c
imp: bumps unicode-segmentation to v1.2 2017-07-29 14:01:55 -04:00
Martin Geisler
c2d4e63756 perf: update textwrap to version 0.7.0
This version of textwrap uses a new wrapping algorithm that allocates
fewer strings on the heap.

The 05_ripgrep benchmarks shows a performance improvement of 3-15%.
The build_help_long benchmark benefits the most since it uses longer
help texts.
2017-07-22 17:17:40 +02:00
Kevin K
76869a0d68 chore: fix increase version 2017-07-21 09:59:01 -04:00
Kevin K
78498bd82c chore: adds CI badges to crates.io 2017-07-21 09:56:06 -04:00
Markus Westerlind
4030c5529d Tell docs.rs about the yaml feature
All the other features are either irrelevant, for nightly or already included by default so this should build with all features.

https://github.com/onur/docs.rs/pull/73

Fixes #911
2017-07-21 09:39:44 -04:00
Kevin K
e27a6ffbde chore: increase version
* chore: disables mention-bots finding reviewers and pinging tons of people

* docs(README.md): added a warning about using ~ deps

* chore: increase version
2017-06-19 22:57:54 -04:00
golem131
77763e1e29 Update bitflags 0.8.0 -> 0.9 2017-06-10 17:38:18 -04:00
Martin Geisler
b93870c10a feat: use textwrap crate for wrapping help texts
The textwrap crate uses a simpler linear-time algorithm for wrapping
the text. The current algorithm in wrap_help uses several O(n) calls
to String::insert and String::remove, which makes it potentially
quadratic in complexity.

Comparing the 05_ripgrep benchmark at commits textwrap~2 and textwrap
gives this result on my machine:

 name              before ns/iter  after ns/iter  diff ns/iter   diff %
 build_app_long    22,101          21,099               -1,002   -4.53%
 build_app_short   22,138          21,205                 -933   -4.21%
 build_help_long   514,265         284,467            -229,798  -44.68%
 build_help_short  85,720          85,693                  -27   -0.03%
 parse_clean       23,471          22,859                 -612   -2.61%
 parse_complex     29,535          28,919                 -616   -2.09%
 parse_lots        422,815         414,577              -8,238   -1.95%

As part of this commit, the wrapping_newline_chars test was updated.
The old algorithm had a subtle bug where it would break lines too
early. That is, it wrapped the text like

    ARGS:
        <mode>    x, max, maximum   20 characters, contains
                  symbols.
                  l, long           Copy-friendly,
                  14 characters, contains symbols.
                  m, med, medium    Copy-friendly, 8
                  characters, contains symbols.";

when it should really have wrapped it like

    ARGS:
        <mode>    x, max, maximum   20 characters, contains
                  symbols.
                  l, long           Copy-friendly, 14
                  characters, contains symbols.
                  m, med, medium    Copy-friendly, 8
                  characters, contains symbols.";

Notice how the word "14" was incorrectly moved to the next line. There
is clearly room for the word on the line with the "l, long" option
since there is room for "contains" just above it.

I'm not sure why this is, but the algorithm in textwrap handles this
case correctly.
2017-05-29 17:02:57 -04:00
Martin Geisler
dd4c41e237 cargo: restrict unicode-segmentation to ~1.1.0
The newly released version 1.2.0 of unicode-segmentation adds code
that use the "?" operator, which in turn requires Rust 1.13.0.
However, clap currently still works with Rust 1.11.0 and this caused
build failures:

  https://travis-ci.org/kbknapp/clap-rs/jobs/235010822

The changes since 1.1.0 seem to be related cursors/iterators and I
think clap can work fine without them.
2017-05-28 19:37:53 -04:00
Kevin K
2923515a0a chore: increase version' 2017-05-16 07:23:22 -04:00
golem131
3deb1943e0 Dependency update 2017-05-11 20:45:15 -04:00
Kevin K
c556b39fd0 chore: increase version 2017-05-07 10:46:03 -04:00
Kevin K
bd4dbb4214 chore: increase version 2017-05-05 18:59:32 +02:00
Kevin K
2572150558
chore: increase version 2017-04-18 23:19:24 -04:00
Kevin K
f842e8fcec
chore: increase version 2017-04-09 14:40:43 -04:00
Kevin K
e05100b73d
imp: bumps term_size to take advantage of better terminal dimension handling 2017-04-09 14:39:38 -04:00
Kevin K
6095f239ba chore: increase version 2017-04-05 10:59:55 -04:00
Kevin K
b48a5bb930 chore: bump minor version due to bug fix that may break code that was relying on said bug 2017-04-04 20:11:33 -04:00
Kevin K
8bcc4d632c chore: increase version 2017-03-30 13:35:36 -04:00
Kevin K
f922b05178 chore: increase version 2017-03-24 11:27:23 -04:00
Kevin K
cc1985b6d8
chore: increase version 2017-03-22 20:29:40 -04:00
Kevin K
0b4177f151
chore: increase version 2017-03-22 20:23:55 -04:00
Kevin K
684aa99ee0
chore: increase version 2017-03-16 21:50:26 -04:00
Kevin K
e7c2eafb26
chore: increase version 2017-03-12 12:56:23 -04:00
Kevin K
10f1ebce7f
chore: ups the codegen units for test builds 2017-03-11 12:14:54 -05:00
Kevin K
9d4535e1c3
chore: clippy run 2017-03-10 08:24:30 -05:00
Kevin K
a2e31b27b0
chore: increase version 2017-03-10 08:24:29 -05:00
Kevin K
432837624c
chore: tags release beta 2017-03-10 08:22:31 -05:00
Anthony Ramine
f4939ad560 Remove direct dependency on libc
It's not actually used anymore anywhere.
2017-03-05 19:44:16 +01:00
Kevin K
5471b67121
chore: updates version to next release num 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
Corey Farwell
242020330d Bump vec_map. 2017-02-28 00:05:53 -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
Igor Gnatenko
d19d56e635 Cargo.toml: bump bitflags 2017-02-25 23:57:14 +01:00
Peter Williams
68e03681d8 refactor: use the atty crate for isatty() detection
Not only does this remove some unsafe code from clap itself, `atty` does the
right thing on Windows too. This isn't relevant now since we don't currently
support colorized output on Windows, but will come in handy if/when we
implement that feature (#836).
2017-02-19 11:12:55 -05:00
Kevin K
6f9a0baff2 chore: increase version (#858) 2017-02-18 11:45:30 -05:00
Kevin K
e3296e566b Docs (#854)
* docs(App::template) adds missing categories and fixes descriptions

* docs(clap_app): documents all the shorthand syntax

Closes #736

* chore: fixes crates.io category...hopefully
2017-02-16 09:44:44 -05:00
Kevin K
31a6b17a92
chore: increase version 2017-02-15 11:06:48 -05:00
Kevin K
cb1818f23a
chore: fixes crates.io category 2017-02-15 11:04:55 -05:00
Kevin K
92919f5f67 Call this PR "Raid" cause it's squashin bugs! (#843)
* tests: adds tests for default values triggering conditional requirements

* fix: fixes a bug where default values should have triggered a conditional requirement but didnt

Closes #831

* tests: adds tests for missing conditional requirements in usage string of errors

* fix: fixes a bug where conditionally required args werent appearing in errors

* tests: adds tests for completion generators

* tests: adds tests for completions with binaries names that have underscores

* fix: fixes a bug where ZSH completions would panic if the binary name had an underscore in it

Closes #581

* fix: fixes bash completions for commands that have an underscore in the name

Closes #581

* chore: fix the category for crates.io

* docs(Macros): adds a warning about changing values in Cargo.toml not triggering a rebuild automatically

Closes #838

* fix(Completions): fixes a bug where global args weren't included in the generated completion scripts

Closes #841

* fix: fixes a println->debugln typo

* chore: increase version
2017-02-03 17:43:49 -05:00
Kevin K
07d985d8c5 Issues 839,840 (#842)
* fix: fixes a critical bug where subcommand settings were being propogated too far

Closes #832

* imp: adds ArgGroup::multiple to the supported YAML fields for building ArgGroups from YAML

Closes #840

* chore: increase version
2017-02-03 15:46:25 -05:00
Kevin K
8e2e7448e9
chore: increase version 2017-01-29 21:24:40 -05:00
Kevin K
6802ac4a59
imp: updates libc and term_size deps for the libc version conflict 2017-01-29 21:18:57 -05:00
Jimmy Cuadra
c0bccaa474 Relax dependency version constraints. (#823)
It's good practice for a library not to depend on exact versions of any
other libraries, so that downstream programs are able to update
dependencies they have in common at their leisure.

This is described in the Cargo documentation at:
http://doc.crates.io/faq.html#why-do-binaries-have-cargolock-in-version-control-but-not-libraries

An example of the problem an exact version depedency creates can be seen
at https://gist.github.com/jimmycuadra/ac26eca5f11960c357d6fba841640f2f.

This patch modifies Cargo.toml to allow semver-compatible updates to
clap's dependencies.
2017-01-29 18:14:46 -08:00
Jake Goulding
8615aee9ac Add categories to Cargo.toml 2017-01-20 11:16:49 -05:00
Kevin K
20a2d95ddf
chore: bumps term_size version 2017-01-02 12:23:03 -05:00
Kevin K
fabe9267ee
chore: updates deps and pins pre-1.0 crates 2016-12-30 22:03:36 -05:00
Kevin K
1c9e8700d4
chore: bumps version in prep for more commits 2016-12-28 23:57:13 -05:00
Kevin K
68dadde061 Merge branch 'master' into issue-shortcircuit-help 2016-12-28 09:33:16 -05:00
Kevin K
e79124e4c2
chore: increase version 2016-12-28 04:26:59 -05:00
Jędrzej
6fdd2f9d69 feat(no_cargo): add no_cargo feature to disable Cargo-env-var-dependent macros (#786) 2016-12-27 21:07:59 -05:00
Kevin K
7144419598
chore: increase version 2016-12-08 15:41:03 -05:00
Kevin K
a9d5453085
chore: increase version 2016-12-01 18:53:26 -05:00
Kevin K
cf0638452a
chore: updates the minimum regex crate version 2016-11-20 21:27:38 -05:00