From aa1f1f8010db3ed9a35579f2e83c574650c41237 Mon Sep 17 00:00:00 2001 From: Felipe Contreras Date: Tue, 27 Oct 2020 20:06:54 -0600 Subject: 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 Signed-off-by: Junio C Hamano --- contrib/completion/git-completion.zsh | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'contrib') diff --git a/contrib/completion/git-completion.zsh b/contrib/completion/git-completion.zsh index f524c6042a..e567062505 100644 --- a/contrib/completion/git-completion.zsh +++ b/contrib/completion/git-completion.zsh @@ -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 --*=*|*.) ;; -- cgit v1.2.3