Skip to content

Commit

Permalink
completion: zsh: fix completion for --no-.. options
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
felipec committed Oct 27, 2020
1 parent d720a44 commit fb9a0f5
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions git-completion.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,32 @@ __gitcomp ()
case "$cur_" in
--*=)
;;
--no-*)
local c IFS=$' \t\n'
local -a array
for c in ${=1}; do
if [[ $c == "--" ]]; then
continue
fi
c="$c${4-}"
case $c in
--*=|*.) ;;
*) c="$c " ;;
esac
array+=("$c")
done
compset -P '*[=:]'
compadd -Q -S '' -p "${2-}" -a -- array && _ret=0
;;
*)
local c IFS=$' \t\n'
local -a array
for c in ${=1}; do
if [[ $c == "--" ]]; then
c="--no-...${4-}"
array+=("$c ")
break
fi
c="$c${4-}"
case $c in
--*=*|*.) ;;
Expand Down

0 comments on commit fb9a0f5

Please sign in to comment.