Commit graph

82 commits

Author SHA1 Message Date
Alex M
60dfcf13b5 Allow for nested subcommands with ZSH generation. 2020-08-23 09:33:29 -07:00
aspen
96b7fd454b
Forbid all unsafe code. 2020-08-20 18:38:40 -04:00
Marti Raudsepp
64ee0f8009 Add hinting of arg value types for zsh/fish completion
Adds new method/attribute `Arg::value_hint`, taking a `ValueHint` enum
as argument. The hint can denote accepted values, for example: paths,
usernames, hostnames, commands, etc.

This initial implementation supports hints for the zsh and fish
completion generators, support for other shells can be added later.
2020-08-06 22:17:31 +03:00
Nicholas Nethercote
217b111bd7 refactor: Replace it.find(...).is_none() with !it.any(...). 2020-07-29 10:35:22 +10:00
CreepySkeleton
37c1631f06 Make lifetimes descriptive 2020-07-21 18:59:07 +03:00
bors[bot]
aab97614ed
Merge #2020
2020: Implementation of feature request #1918 r=pksunkara a=leo-lb



Co-authored-by: Léo Le Bouter <lle-bout@zaclys.net>
2020-07-21 09:47:23 +00:00
Léo Le Bouter
eabe8b67b4 Implementation of feature request #1918 2020-07-20 15:35:40 +02:00
Marti Raudsepp
594c535ba2 Fix various typos in docs & code
Most errors detected and fixed with Topy (https://github.com/intgr/topy),
all verified by hand.
2020-07-19 03:10:28 +03:00
CreepySkeleton
7e8d120543 Make getters return iterators rather than slices 2020-07-06 17:33:02 +03:00
CreepySkeleton
f904bebd9a Ditch find_subcnd*! and match_alias! 2020-06-27 04:30:02 +03:00
CreepySkeleton
b7be22e90b Ditch opts! and positionals! 2020-06-27 04:30:01 +03:00
CreepySkeleton
f46af5b96b Ditch flags! 2020-06-27 04:30:01 +03:00
Pavan Kumar Sunkara
1a276f8f4f Remove Arg::help 2020-06-10 09:34:55 +02:00
Pavan Kumar Sunkara
7bc282dd4e Rename with_name to new for Arg & ArgGroup 2020-05-14 22:50:56 +02:00
Josh Holland
5948754d2f fix(completions): improve correctness of completions when whitespace is involved
compgen takes exactly one "word" argument; if multiple are passed, it
will ignore all but the first. If `$cur` is not quoted and contains
whitespace, it will be expanded into multiple words, so the completions
will be based only on the first word of `$cur`, which is clearly not
correct.

To fix this, quote `$cur` to prevent word splitting, where necessary
(Bash does not perform word splitting inside the extended test command
`[[`, so quotes aren't necessary there).
2020-05-12 01:32:15 +02:00
Pavan Kumar Sunkara
b562ce4d63 Some modifications to allow cargo verification to work 2020-05-03 11:48:01 +02:00
creativcoder
92d5920748 Updated test and usage of older help APIs with about 2020-04-27 02:42:07 +05:30
creativcoder
75f5a9ab62 Code review p1 2020-04-27 02:42:07 +05:30
creativcoder
24cb8b13c5 Deprecate Arg::help in favour of Arg::about 2020-04-27 02:42:07 +05:30
Pavan Kumar Sunkara
f0074752b9 Improve debug logs 2020-04-22 20:56:35 +02:00
Pavan Kumar Sunkara
070bd50b28 Finished color refactor 2020-04-16 12:51:26 +02:00
CreepySkeleton
7cff206194 Make all fields of App & Arg pub(crate) 2020-04-11 18:23:20 +03:00
Pavan Kumar Sunkara
b45746feff Remove some defaults from profiles 2020-04-10 17:19:26 +02:00
Pavan Kumar Sunkara
cceb29623a Remove nightly feature 2020-04-10 10:42:25 +02:00
CreepySkeleton
5d9ef1527f Fix warnings in tests & examples 2020-03-05 13:40:25 +03:00
CreepySkeleton
d466a56aa1 Fix benches 2020-03-04 21:31:18 +03:00
quake wang
bb4a6df5ba fix: bash completions with app name which contains - 2020-03-01 23:35:49 +01:00
CreepySkeleton
4f13f3155c Fix warnings on nightly 2020-02-21 01:55:19 +03:00
Pavan Kumar Sunkara
970d7140a3 Use 'Clap Maintainers' as authors 2020-02-10 20:16:25 +01:00
Ole Martin Ruud
da7e9e5505 Escape colon in zsh completion help 2020-02-07 07:52:04 +01:00
Pavan Kumar Sunkara
e6f77a8713 Added helper methods to generator 2020-02-07 07:52:04 +01:00
Pavan Kumar Sunkara
33f47acc67 Refactor clap_generate 2020-02-07 07:52:04 +01:00