mirror of
https://github.com/clap-rs/clap
synced 2024-11-10 14:54:15 +00:00
170bd59111
zsh completions for commands that have multiple Vec arguments require special care. We can have two Vec args separated with a value terminator. We can also have two Vec args with no value terminators specified where the final arg uses 'raw' and thus requires '--' to be used. The 2nd of these scenarios requires special handling to avoid emitting a duplicate '*:arguments' completion entry. Currently, the zsh completions generate an error in this scenario: $ my-app <TAB> _arguments:...: doubled rest argument definition: *::second -- second set of of multi-length arguments: We already use the '-S' option when calling _arguments. This option makes it so that completion stops after '--' is encountered. This means that the handling for trailing 'raw' arguments does not need to specified. Special-case multi-valued arguments so that we can skip emitting the final multi-valued argument if a previous multi-valued argument has already been emitted. Closes #3022 Signed-off-by: David Aguilar <davvid@gmail.com>
1 line
48 B
Fish
1 line
48 B
Fish
complete -c my-app -s h -l help -d 'Print help'
|