From 46365cf8be5331ba04c895eb183e2f230b5aad51 Mon Sep 17 00:00:00 2001 From: Segev Finer Date: Sat, 6 Jan 2018 12:57:31 +0200 Subject: [PATCH] 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. --- src/completions/zsh.rs | 2 +- tests/completions.rs | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/completions/zsh.rs b/src/completions/zsh.rs index 8fbc1ff69f5..c73a9878b96 100644 --- a/src/completions/zsh.rs +++ b/src/completions/zsh.rs @@ -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, diff --git a/tests/completions.rs b/tests/completions.rs index 1afc6bcb08c..953b68c2a0e 100644 --- a/tests/completions.rs +++ b/tests/completions.rs @@ -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]' \