Commit graph

2217 commits

Author SHA1 Message Date
Segev Finer
25561decf1 feat(completions/zsh.rs): Escape possible values for options 2018-01-16 01:55:48 +02:00
Segev Finer
2cbbfa8ce9 style(completions/zsh.rs): Cleanup documentation and naming 2018-01-16 01:52:44 +02:00
Segev Finer
f3b0afd2be feat(completions/zsh.rs): Implement postional argument possible values completion 2018-01-16 01:52:44 +02:00
Segev Finer
a652260795 fix(completions/zsh.rs): Add missing autoload for is-at-least 2018-01-15 20:41:08 +02:00
Kevin K
e077e0c930
Merge branch 'master' into zsh-completion-improvements 2018-01-15 11:53:25 -05:00
Kevin K
e078a5893b
Merge pull request #1146 from kraai/patch-2
fix: Fix typos
2018-01-15 11:53:08 -05:00
Kevin K
4fec24a6ac
Merge branch 'master' into patch-2 2018-01-15 11:52:53 -05:00
Kevin K
55ea76cd99
Merge pull request #1145 from kraai/patch-1
Fix typo
2018-01-15 11:52:26 -05:00
Kevin K
a46ff132f1
Merge branch 'master' into patch-1 2018-01-15 11:52:21 -05:00
Kevin K
d548e546ef
Merge pull request #1144 from segevfiner/zsh-redundant-code
fix(completions/zsh.zsh): Remove redundant code from output
2018-01-15 11:51:55 -05:00
Segev Finer
16b4f143ff fix(completions/zsh.rs): Don't pass -S to _arguments if Zsh is too old
If you do pass it than _arguments considers -C as a possible option in
the completions.
2018-01-14 07:13:27 +02:00
Segev Finer
1146f0da15 fix(completions/zsh.rs): Maybe fix completions with mixed positionals and subcommands
Optional positionals mixed with subcommands will still break this, since
I can't see how to tell which element of $line is the command than.
Mixing optional positionals with subcommands is a bit weird and awkward
though...
2018-01-14 07:13:23 +02:00
Segev Finer
e39aeab848 feat(completions/zsh.rs): Complete positional arguments properly
This changes the way we complete positionals to complete them using
_arguments, as should be done, instead of completing their uppercase name
as a string.

Currently I made it offer _files completion for all positional arguments.
This can be improved to complete actual possible values of the arguments
and only complete files if the argument truly takes them. But this will
require further changes in clap to actually have the required
functionality to get this information.
2018-01-14 07:12:14 +02:00
Matt Kraai
cc341243f3
Fix typos 2018-01-10 21:49:40 -08:00
Matt Kraai
b83f387b80
Fix typo 2018-01-10 21:01:21 -08:00
Segev Finer
0e185b922e fix(completions/zsh.zsh): Remove redundant code from output
Fixes #1142
2018-01-10 20:29:01 +02:00
Kevin K
d78341f640
Merge pull request #1143 from kbknapp/trim-fat
Trim fat
2018-01-09 16:52:05 -05:00
Kevin K
3fef176543 docs: fixes typo in docs version 2018-01-09 12:07:19 -05:00
Kevin K
3e97085e58 chore: udpates html doc root 2018-01-09 12:02:35 -05:00
Kevin K
92caafaf51 chore: increase version 2018-01-09 11:08:47 -05:00
Kevin K
e1313a5a0f docs: updates contributors list 2018-01-09 11:04:56 -05:00
Kevin K
eb8d919e6f perf: further debloating by removing generics from error cases 2018-01-09 10:53:20 -05:00
Kevin K
7ac5a5af9f tests: cleans up certain test cases litle by little 2018-01-09 10:53:20 -05:00
Kevin K
03e413d717 perf: debloats clap by deduplicating logic and refactors
This commit removes heavy use of macros in certain functions which
drastically increased code size. Some of the macros could be turned
into functions, while others could be removed entirely.

Examples were removing arg_post_processing! which did things like
checked overrides, requirements, groups, etc. This would happen
after every argument was parsed. This macro also had several other
macros inside it, and would expand to several tens or hundreds of
lines of code.

Then add that due to borrowck and branch issues, this macro may be
included in multiple parts of a function. Unlike traditional functions
each of these uses expanded into TONS of code (just like agressive
inlining).

This commit primarily removes those arg_post_processing! calls and
breaks up the functionality into two types. The first must happen at
ever new argument (not new value, but new argument). This is pretty
cheap. The next type was moved to the end of parsing validation section
which is more expensive, but only happens once.

i.e. clap was validating each argument/value as it saw them, now it's
lazy and validates them all at once at the end. This MUCH more
efficient!
2018-01-09 10:53:20 -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
Kevin K
79c36396db tests: adds a check_output2 function to compare output to one of two possible solutions 2018-01-09 10:53:20 -05:00
Kevin K
6f25b2830a chore: adds .idea project folder to ignore list 2018-01-09 10:53:20 -05:00
Kevin K
28a55f28a2
Merge pull request #1141 from segevfiner/zsh-long-options-completion-fix
Fix completion of long option values in Zsh
2018-01-09 10:53:03 -05:00
Kevin K
eac4ca7898
Merge branch 'master' into zsh-long-options-completion-fix 2018-01-09 10:50:40 -05:00
Kevin K
f3cd07bf6a
Merge pull request #1138 from cldershem/fixDocLinks
docs: fixes broken links.
2018-01-09 10:49:28 -05:00
Kevin K
a23135a46a
Merge branch 'master' into fixDocLinks 2018-01-09 10:49:21 -05:00
Kevin K
666c5184d5
Merge pull request #1130 from fluffysquirrels/master
Fix for issue #1129: "Bug: Bash completion is broken when sub-commands have hyphens"
2018-01-09 10:48:24 -05:00
Segev Finer
46365cf8be fix(completions/zsh.rs): Fix completion of long option values
Long options take their argument either in the next word or after an
equals sign, but the Zsh completion specified that they take it either
in the same word with no separator or in the next word. See the
documentation of the Zsh _arguments function for more information.
2018-01-06 14:43:15 +02:00
Cameron Dershem
56e734b839 docs: fixes broken links.
Small correction to add a link to the source in the documentation, previously
it was a placeholder.

`rustdoc` does not appear to package assets with the docs, therefore
relative links looking for static files do not work. The links are
consistent enough on github that the static files can be directly linked
to on the master branch.
2017-12-27 00:00:06 -05:00
Alex Helfet
ba7f1d18eb fix(bash completion): Change the bash completion script code generation to support hyphens. 2017-12-16 12:44:57 +00:00
Alex Helfet
b446a561ce tests(auto-completion): Update build_app_special_commands to include a sub-command with a hypen.
The tests pass but the bash completion script won't work yet.
2017-12-16 12:44:44 +00:00
Alex Helfet
09d1d4a568 tests(auto-completion): Normalise names in tests/completions.rs
From            -> To
===========================================
with_underscore -> (with_)?special_commands
WUS             -> SPECIAL_CMDS
special         -> special_help
SPECIAL         -> SPECIAL_HELP
2017-12-16 12:44:12 +00:00
Kevin K
e0f8479e0f
Merge pull request #1124 from Enet4/arg_enum_trailing_comma
Support trailing comma in arg_enum! fields
2017-12-07 16:45:28 -05:00
Eduardo Pinho
dde7fcf1ca Support trailing comma in arg_enum! fields 2017-12-07 00:53:55 +00:00
Kevin K
f38cb1dbb7
Merge pull request #1123 from rom1v/readme
Update default features in README
2017-12-05 09:44:57 -05:00
Romain Vimont
d954b3c734 Update default features in README
Since commit ac97edde90, feature
"wrap_help" is not enabled by default.

Update the README accordingly.
2017-12-05 13:55:57 +01:00
Kevin K
4442af96c6
Merge pull request #1122 from kbknapp/hide-env-vars
Hide env vars
2017-12-03 09:32:51 +09:00
Kevin K
e962f2cece
chore: increase version 2017-12-02 15:34:02 -05:00
Kevin K
ebc35bdc91
tests: adds tests for both showing and hiding the values inside ENV vars 2017-12-02 15:09:22 -05:00
Kevin K
fb41d062ee
api(Arg): adds Arg::hide_env_values(bool) which allows one to hide any current env values and display only the key in help messages 2017-12-02 15:09:21 -05:00
Kevin K
a652db08eb
Merge pull request #1121 from ignatenkobrain/patch-4
bump lazy_static to 1
2017-12-03 05:08:26 +09:00
Igor Gnatenko
f74e2dc45f
bump lazy_static to 1 2017-11-30 17:41:34 +01:00
Kevin K
bc9ab21934
Merge pull request #1119 from kbknapp/case-insensitive
Case insensitive
2017-11-29 00:35:31 +09:00
Kevin K
4e2881c3d2
docs: updates the contributors list 2017-11-28 08:57:04 -05:00
Kevin K
58a57d901b
chore: increase version 2017-11-28 08:57:04 -05:00