completion: zsh: fix completion for --no-.. options
This was introduced in upstream's bash script, but never in zsh's: b221b5ab9b (completion: collapse extra --no-.. options) It has been failing since v2.19. Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Felipe Contreras committed
Oct 27, 2020 at 20:06 UTC
aa1f1f8010db3ed9a35579f2e83c574650c41237
1 file changed
+22
contrib/completion/git-completion.zsh
+22
@@ -59,10 +59,32 @@ __gitcomp ()
59
case "$cur_" in
60
--*=)
61
;;
62
+ --no-*)
63
+ local c IFS=$' \t\n'
64
+ local -a array
65
+ for c in ${=1}; do
66
+ if [[ $c == "--" ]]; then
67
+ continue
68
+ fi
69
+ c="$c${4-}"
70
+ case $c in
71
+ --*=|*.) ;;
72
+ *) c="$c " ;;
73
+ esac
74
+ array+=("$c")
75
+ done
76
+ compset -P '*[=:]'
77
+ compadd -Q -S '' -p "${2-}" -a -- array && _ret=0
78
+ ;;
79
*)
80
local c IFS=$' \t\n'
81
local -a array
82
for c in ${=1}; do
83
+ if [[ $c == "--" ]]; then
84
+ c="--no-...${4-}"
85
+ array+=("$c ")
86
+ break
87
+ fi
88
c="$c${4-}"
89
case $c in
90
--*=*|*.) ;;