mirror of
https://github.com/clap-rs/clap
synced 2024-12-14 14:52:33 +00:00
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:
parent
e0f8479e0f
commit
46365cf8be
2 changed files with 4 additions and 4 deletions
|
@ -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,
|
||||
|
|
|
@ -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]' \
|
||||
|
|
Loading…
Reference in a new issue