Commit graph

1676 commits

Author SHA1 Message Date
Arnavion
f41ec962c2 feat(clap_app!): Support --("some-arg-name") syntax for defining long arg names
Used for arg names that aren't idents.

Ref #321
2016-12-12 22:42:11 -08:00
Arnavion
9895b671cf feat(clap_app!): Support ("some app name") syntax for defining app names
Used for setting names that aren't Rust idents.

Fixes #759
2016-12-12 22:42:11 -08:00
Arnavion
79bbf57815 tests(clap_app!): Added test for clap_app! macro. 2016-12-12 22:42:11 -08:00
Homu
274afb1f08 Auto merge of #773 - musoke:doc_spelling, r=kbknapp
Spelling in docs

Just some typos I noticed while reading the docs.
2016-12-11 12:02:20 +09:00
Nathan Musoke
f22c21b422 docs(README.md): fix some typos 2016-12-11 11:54:40 +13:00
Nathan Musoke
5c9b0d47ca docs(src/app/mod.rs): fix some typos 2016-12-11 11:36:37 +13:00
Homu
ff5d1a753d Auto merge of #772 - kbknapp:issue-771, r=kbknapp
Issue 771
2016-12-09 11:53:40 +09:00
Homu
ff7febf3f9 Auto merge of #767 - kbknapp:issue-765, r=kbknapp
docs(README.md): adds guidance on when to use ~ in version pinning, a…

…nd clarifies breaking change policy

Closes #765

cc @joshtriplett
2016-12-09 06:02:22 +09:00
Kevin K
7144419598
chore: increase version 2016-12-08 15:41:03 -05:00
Kevin K
7e17d5a36b
fix(ZSH Completions): escapes square brackets in ZSH completions
Since ZSH completions use `[ and ]` for descriptions, but clap args use `[ and ]` for possible
values and other auxillary arg information, this was creating a conflict. clap now escapes any
square brackets before writing the help, i.e. `\\[ and \\]` which removes conflicts.

Alternatives would be to switch `[ and ]` for `( and )` but this would create a slight difference
in help messages and completions.

Closes #771
2016-12-08 15:36:18 -05:00
Kevin K
591eaefc73
docs(README.md): adds guidance on when to use ~ in version pinning, and clarifies breaking change policy
Closes #765
2016-12-08 11:35:38 -05:00
Homu
949690ee4a Auto merge of #768 - kbknapp:issue-766, r=kbknapp
docs(Examples): adds subcommand examples

Closes #766

cc @omtcyfz
2016-12-08 11:10:36 +09:00
Andrew Gallant
4aec1a5441 Query OUT_DIR at runtime. (#770)
It seems that Cargo no longer sets OUT_DIR when compiling build.rs, but
it's still available at runtime. Therefore, switch `env!` to
`env::var_os`.
2016-12-07 19:30:54 -05:00
Kevin K
0e0f33547a
docs(Examples): adds subcommand examples
Closes #766
2016-12-07 15:28:21 -05:00
Homu
b225cdb125 Auto merge of #762 - kbknapp:issue-threedots, r=kbknapp
Issue threedots
2016-12-02 23:00:47 +09:00
Kevin K
56bd25ab38 Merge branch 'master' into issue-threedots 2016-12-01 23:54:22 -05:00
Homu
12a5f6e0cf Auto merge of #761 - mernen:bash-completion, r=kbknapp
imp(Completions): adds fallbacks to Bash completions

With these options, in case the completion function cannot provide suggestions, Bash will perform its default completions, based on e.g. files, directories, and variable names.

This is particularly noticeable in tools that operate on paths, like ripgrep: when I type `rg should_panic te<TAB>`, I want the shell to autocomplete `tests/`, but right now the completion script will simply beep without any suggestions.
2016-12-02 10:57:43 +09:00
Daniel Luz
b1b16d56d8 imp(Completions): adds fallbacks to Bash completions
With these options, in case the completion function cannot provide
suggestions, Bash will perform its default completions, based on e.g.
files, directories, and variable names. This is particularly useful for
argument values.
2016-12-01 23:27:35 -02:00
Kevin K
a9d5453085
chore: increase version 2016-12-01 18:53:26 -05:00
Kevin K
29e362cc19
tests: adds tests against issue 760 help message alignment 2016-12-01 18:47:20 -05:00
Kevin K
cd94b3188d
fix(Help Messages): fixes help message alignment when specific settings are used on options
Prior to this commit setting `number_of_values(1)` and `multiple(true)` would cause the help
message alignment to be off. This commit fixes that.

Closes #760
2016-12-01 18:45:24 -05:00
Homu
69541d6daf Auto merge of #758 - mineo:patch-1, r=kbknapp
docs(Readme): Fix typos
2016-11-29 01:35:46 +09:00
Wieland Hoffmann
c9e75a1d83 docs(Readme): Fix typos 2016-11-27 18:52:35 +01:00
Homu
8dce24870b Auto merge of #756 - matthiasbeyer:fix-readme, r=kbknapp
Fix typo: 2.12.0 -> 1.12.0

Fixing a typo here.
2016-11-21 23:15:18 +09:00
Matthias Beyer
b8fb6725c5 Fix typo: 2.12.0 -> 1.12.0 2016-11-21 09:07:30 +01:00
Homu
2cde6b5773 Auto merge of #755 - kbknapp:issues-740,742,744,753,754, r=kbknapp
Issues 740,742,744,753,754
2016-11-21 13:10:45 +09:00
Kevin K
cf0638452a
chore: updates the minimum regex crate version 2016-11-20 21:27:38 -05:00
Kevin K
802cd1bf17
docs: fixes the doc landing page 2016-11-20 21:27:17 -05:00
Kevin K
36e9d29b01
chore: fixes build failure for 1.11.0 2016-11-20 21:26:36 -05:00
Kevin K
979e8e0d2f
chore: increase version 2016-11-20 21:00:26 -05:00
Kevin K
6f5b1103c0
chore: updates the pinned rust nightly 2016-11-20 21:00:01 -05:00
Kevin K
01e1e33f37
docs: updates the docs landing page 2016-11-20 20:59:00 -05:00
Kevin K
45eb9bf130
docs: adds the macro version back to the readme 2016-11-20 20:48:33 -05:00
Kevin K
c04a6cbef3
chore: pins minimum version of rust 2016-11-20 20:48:19 -05:00
Kevin K
49e7cdab76
fix(ZSH Completions): fixes an issue where zsh completions caused panics if there were no subcommands
Closes #754
2016-11-20 13:13:01 -05:00
Kevin K
d20331b6f7
fix(Required Unless): fixes a bug where having required_unless set doesn't work when conflicts are also set
Closes #753
2016-11-20 12:10:14 -05:00
Kevin K
eb51316cdf
docs(Contributing): updates the readme to improve the readability and contributing sections 2016-11-20 09:32:18 -05:00
Kevin K
760d66dc17
docs(Compatibility Policy): adds an official compatibility policy to
Closes #740
2016-11-20 09:30:56 -05:00
Kevin K
65eb33859d
imp(Validators): improves the error messages for validators
Failing value validators now produce messages like the following:

error: Invalid value for '-j <val>': some message about the value

Closes #744
2016-11-20 08:36:26 -05:00
Kevin K
d0d8622dd6
chore: adds a cleaning recipie 2016-11-20 14:51:08 -05:00
Kevin K
80cc68748d
chore: rustfmt run 2016-11-20 14:47:04 -05:00
Kevin K
ba7a4e33e1
chore: adds recipies for benchmarks 2016-11-20 14:47:04 -05:00
Kevin K
b1053f1016
chore: clippy run 2016-11-20 14:47:04 -05:00
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