diff options
author | Felipe Contreras <felipe.contreras@gmail.com> | 2020-10-27 20:06:54 -0600 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2020-10-28 14:30:59 -0700 |
commit | aa1f1f8010db3ed9a35579f2e83c574650c41237 (patch) | |
tree | df39803efaf44b6e68e9ec4f35325a9568f3efe8 /contrib | |
parent | completion: bash: remove zsh wrapper (diff) | |
download | tgif-aa1f1f8010db3ed9a35579f2e83c574650c41237.tar.xz |
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>
Diffstat (limited to 'contrib')
-rw-r--r-- | contrib/completion/git-completion.zsh | 22 |
1 files changed, 22 insertions, 0 deletions
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 --*=*|*.) ;; |