Commit graph

20 commits

Author SHA1 Message Date
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
988b9cbea4
style: standardizes debug calls and output
Closes #792
2016-12-29 23:34:46 -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
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
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
80cc68748d
chore: rustfmt 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
Kevin K
e600f49b77
chore: clippy run 2016-11-12 12:20:45 -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
Kevin K
b4f2e2a1b6
chore: clippy run 2016-11-11 15:48:40 -05:00
Kevin K
55e7385685
style: changes try! to ? and rustfmt run 2016-11-11 15:20:07 -05:00
Arnavion
5869ebbffc Completion support for PowerShell.
Fixes #729
2016-11-05 02:47:23 -07:00
Kevin K
3d37001d1d
imp(Error Output): conflicting errors are now symetrical, meaning more consistent and less confusing
Prior to this commit, conflicting error messages and the suggeseted usage would depend on whether
you defined the conflict on both arguments, or just one, and the order in which you specified the
conflicting arguments at runtime.

Now they are symetrical, meaning the suggestions from the error message are consistent, and it no
longer matters if you specify the conflict in one, or both arguments.

Closes #718
2016-10-31 00:35:23 -04:00
Kevin K
5c70e1a01b
fix(ZSH Completions): fixes bug that caused panic on subcommands with aliases
ZSH completions now fully support subcommands with aliases. Only visible aliases will be displayed
in the completions.

Closes #714
2016-10-30 19:18:13 -04:00
Kevin K
6c11ccf443 fix(debug): fixes the debug feature (#716) 2016-10-29 11:10:14 -04:00
Kevin K
780b4a1828
fix(Fish Completions): fixes a bug where single quotes are not escaped
Closes #704
2016-10-25 10:34:46 -04:00
Kevin K
e9efa8ed6f
chore: clippy run 2016-10-24 05:56:32 -04:00
Kevin K
3e36b0bac4
feat(Completions): adds ZSH completion support
ZSH is now supported in the exact same way as BASH and FISH completion scripts.

Closes #699
2016-10-23 19:32:52 -04:00
Kevin K
ee6e987acd
refactor(Completions): moves completing functions into their own modules 2016-10-23 19:31:24 -04:00