Commit graph

1683 commits

Author SHA1 Message Date
Kevin K
c0d70febad
feat: allows specifying AllowLeadingHyphen style values, but only for specific args vice command wide
One can now use `Arg::allow_hyphen_values(true)` which will enable `--opt -val` style values only
for the specific arg and not command wide.

Closes #742
2016-11-20 14:47:04 -05:00
Kevin K
cf9d6ce5cd
refactor: refactors the internals a bit
Flags, Opts, and Positionals now store their internals using compartmented Base, Valued, and
Switched structs to keep the code duplication down and make it easier to maintain.

Iniside the src/app/parser.rs there have been several changes to make reasoning about the code
easier. Primarily moving related sections out of the large get_matches_with into their own
functions.
2016-11-20 14:47:03 -05:00
Matthias Beyer
192a808e0f Use try!() instead of ? operator, for older compilers (#752) 2016-11-16 14:41:26 -05:00
Homu
4181a98131 Auto merge of #749 - tshepang:nits, r=kbknapp
doc: some formatting fixes
2016-11-15 08:01:45 +09:00
Kevin K
4744d07b57 Merge branch 'master' into nits 2016-11-14 16:56:57 -05:00
Homu
fb4214f476 Auto merge of #743 - nabijaczleweli:chore/travis-cache, r=kbknapp
Cache cargo on Travis to (hopefully) speed up builds
2016-11-15 06:33:19 +09:00
Kevin K
0a42375704 Merge branch 'master' into chore/travis-cache 2016-11-14 15:46:04 -05:00
Tshepang Lekhonkhobe
2ebde60d5a doc: some formatting fixes 2016-11-14 20:18:44 +02:00
Homu
4f3155897a Auto merge of #745 - casey:quiet-update-contributors, r=kbknapp
Make `update-contributors` a quiet recipe

I noticed that this is a common pattern in justfiles, recipes that
run a lot of commands and prefix every line with `@` so that
only output is printed.

So I added quiet recipes, which are recipes where the recipe name
is prefixed with a `@`.

Inside quiet recipes the usual meaning of `@` is inverted. Only
lines starting with `@` are echoed.

This diff makes the `update-contributors` recipe a quiet recipe,
and gets rid of all those unsightly `@`s.

PS I just added this in v0.2.21, so you'll need to install the latest version
from crates.io to test.

PPS Thanks for using just! I was super excited to see a justfile in this repo,
since I'm a huge fan of clap.
2016-11-14 13:24:39 +09:00
Kevin K
2a630c9083 Merge branch 'master' into quiet-update-contributors 2016-11-13 20:38:02 -05:00
Homu
a395c0512d Auto merge of #746 - jtdowney:fix-broken-links, r=kbknapp
docs: fix broken docs links

These links are relative to the root of the server instead of the current file. This breaks causes them to be broken on docs.rs.
2016-11-14 02:33:20 +09:00
John Downey
808e7ceeb8 docs: fix broken docs links
These links are relative to the root of the server instead of the
current file. This breaks causes them to be broken on docs.rs.
2016-11-13 11:35:07 -05:00
Casey Rodarmor
8ceb4048d0 Make update-contributors a quiet recipe
Quiet recipes are prefixed with a `@`, and inside quiet recipes the
usual meaning of `@` is inverted. Only lines starting with `@` are
echoed.
2016-11-13 00:23:04 -08:00
nabijaczleweli
4bb45d99f9
chore(travis): Cache cargo to speed up builds 2016-11-13 00:17:57 +01:00
Homu
7bf6f293a7 Auto merge of #739 - Deedasmi:master, r=kbknapp
DOCS: Simple documentation updates

README still had a mistake regarding YAML parsing, and the README and lib.rs referenced the wrong folder name for tests.
2016-11-13 07:32:42 +09:00
Kevin K
390bf5b0e3 Merge branch 'master' into master 2016-11-12 15:36:06 -05:00
Homu
ca0a04a032 Auto merge of #741 - kbknapp:revision, r=kbknapp
Revision
2016-11-13 03:21:00 +09:00
Kevin K
1127e09738
chore: adds a github issue template 2016-11-12 12:21:10 -05:00
Kevin K
e600f49b77
chore: clippy run 2016-11-12 12:20:45 -05:00
Kevin K
356b0251b8
chore: adds some recipies to the justfile 2016-11-12 12:13:48 -05:00
Kevin K
7cb44abc09
Revert "Auto merge of #737 - kbknapp:questionmark, r=kbknapp"
This reverts commit f24a3760e4, reversing
changes made to 087cee7404.
2016-11-12 12:12:05 -05:00
Richard Petrie
bc2552f505 Corrected name of tests folder
Unsure why these are wrong, but simple fixes
2016-11-12 01:08:54 -06:00
Richard Petrie
98c5e21634 Further address #708
21fba9e only resolved the version issue in the subcommand, not on the package. Credit to @tvannahl
2016-11-12 00:55:25 -06:00
Homu
f24a3760e4 Auto merge of #737 - kbknapp:questionmark, r=kbknapp
Questionmark
2016-11-12 06:43:06 +09:00
Kevin K
b4f2e2a1b6
chore: clippy run 2016-11-11 15:48:40 -05:00
Kevin K
d4740a5978
chore: adds some recipies to the justfile 2016-11-11 15:33:38 -05:00
Kevin K
55e7385685
style: changes try! to ? and rustfmt run 2016-11-11 15:20:07 -05:00
Homu
087cee7404 Auto merge of #733 - kbknapp:v2.18.0, r=kbknapp
V2.18.0
2016-11-06 09:20:50 +09:00
Kevin K
475c21814e
chore: increase version 2016-11-05 19:58:30 -04:00
Kevin K
b620323299
chore: updates the contributors list 2016-11-05 19:58:19 -04:00
Kevin K
71e679b3ba
chore: adds a justfile for storing some common commands 2016-11-05 19:58:07 -04:00
Kevin K
cbe252d477
Merge branch 'master' of github.com:kbknapp/clap-rs 2016-11-05 16:09:09 -04:00
Arnavion
cff82c880e
feat(Completions): adds completion support for PowerShell.
Closes #729
2016-11-05 16:06:31 -04:00
Homu
fc22be0f04 Auto merge of #732 - Arnavion:fix-729, r=kbknapp
Completion support for PowerShell.

Fixes #729

---

Requires PS 5.0+ for the `Microsoft.PowerShell.Core\Register-ArgumentCompleter` commandlet. Earlier versions using the equivalent commandlet from TabExpansionPlusPlus may work, but I haven't tested that. PS 5.0 is available for Windows 7 and non-Windows anyway.

The resulting script can be used by pasting it into the PS profile or saving it to a file and sourcing it into the PS profile in the usual way.
2016-11-06 04:08:36 +09:00
Arnavion
5869ebbffc Completion support for PowerShell.
Fixes #729
2016-11-05 02:47:23 -07:00
Homu
a7659ce4f0 Auto merge of #730 - kbknapp:issue-725-take2, r=kbknapp
Issue 725 take2
2016-11-02 13:40:24 +09:00
Kevin K
1118cc08fa
chore: increase version 2016-11-01 23:33:53 -04:00
Kevin K
908d78eb82
tests: adds tests against issue-725 part 2 2016-11-01 23:32:26 -04:00
Kevin K
33924e8844
fix(Low Index Multiples): fixes a bug where using low index multiples was propgated to subcommands
Closes #725
2016-11-01 23:31:29 -04:00
Homu
00b8d16078 Auto merge of #728 - kbknapp:coveralls, r=kbknapp
chore: coveralls upload fix
2016-11-02 12:16:24 +09:00
Kevin K
b71329b8c8
chore: coveralls upload fix 2016-11-01 22:53:48 -04:00
Homu
5cb9c8ad65 Auto merge of #724 - kbknapp:clippy-run, r=kbknapp
Clippy run
2016-11-02 08:57:17 +09:00
Kevin K
90df9d3223
chore: moves to temp coveralls fix 2016-11-01 19:20:55 -04:00
Kevin K
61bde461e1
chore: clippy run 2016-11-01 18:42:03 -04:00
Homu
1ff9791fb4 Auto merge of #727 - kbknapp:issue-725, r=kbknapp
Issue 725
2016-11-02 07:14:52 +09:00
Kevin K
e55e82a418
chore: increase version 2016-11-01 16:28:15 -04:00
Kevin K
74360184fa
tests(Multiple Values): renames some tests to reduce redundancy 2016-11-01 16:25:54 -04:00
Kevin K
ac49e7bc04
tests: adds tests for low index positionals with multiple(true) set 2016-11-01 16:25:54 -04:00
Kevin K
1ced2a7433
feat(Positional Args): allows specifying the second to last positional argument as multiple(true)
Now one can build CLIs that support things like `mv <files>... <target>`

There are a few requirements and caveats;

 * The final positional argument (and all positional arguments prior) *must* be required
 * Only one positional argument may be `multiple(true)`
 * Only the second to last, or last positional argument may be `multiple(true)`

Closes #725
2016-11-01 16:25:54 -04:00
Kevin K
1d6f8fd7de
chore(Completion Error): changes error message to reflect not only BASH is supported 2016-11-01 16:25:47 -04:00