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.
This commit is contained in:
Segev Finer 2018-01-06 12:57:31 +02:00
parent e0f8479e0f
commit 46365cf8be
2 changed files with 4 additions and 4 deletions

View file

@ -371,7 +371,7 @@ fn write_opts_of(p: &Parser) -> String {
}
if let Some(long) = o.long() {
let l = format!(
"'{conflicts}{multiple}--{arg}+[{help}]{possible_values}' \\",
"'{conflicts}{multiple}--{arg}=[{help}]{possible_values}' \\",
conflicts = conflicts,
multiple = multiple,
arg = long,

View file

@ -108,7 +108,7 @@ _myapp() {
case $line[1] in
(test)
_arguments -s -S -C \
'--case+[the case to test]' \
'--case=[the case to test]' \
'-h[Prints help information]' \
'--help[Prints help information]' \
'-V[Prints version information]' \
@ -397,7 +397,7 @@ _my_app() {
case $line[1] in
(test)
_arguments -s -S -C \
'--case+[the case to test]' \
'--case=[the case to test]' \
'-h[Prints help information]' \
'--help[Prints help information]' \
'-V[Prints version information]' \
@ -406,7 +406,7 @@ _arguments -s -S -C \
;;
(some_cmd)
_arguments -s -S -C \
'--config+[the other case to test]' \
'--config=[the other case to test]' \
'-h[Prints help information]' \
'--help[Prints help information]' \
'-V[Prints version information]' \