summaryrefslogtreecommitdiff
path: root/contrib/completion
diff options
context:
space:
mode:
authorFelipe Contreras <felipe.contreras@gmail.com>2020-10-28 02:07:05 (GMT)
committerJunio C Hamano <gitster@pobox.com>2020-10-28 21:30:59 (GMT)
commit9d760527addc576c87e9b0e66b63376e580b434a (patch)
tree7476e3c7c2156f847c78bb798244bf308a3fb77b /contrib/completion
parent9a397ea5ad59e64ff6eebfd1d7dad43aac790e0a (diff)
downloadgit-9d760527addc576c87e9b0e66b63376e580b434a.zip
git-9d760527addc576c87e9b0e66b63376e580b434a.tar.gz
git-9d760527addc576c87e9b0e66b63376e580b434a.tar.bz2
completion: zsh: improve command tags
There's no need to use _alternative and repeat a lot of the code. Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'contrib/completion')
-rw-r--r--contrib/completion/git-completion.zsh11
1 files changed, 7 insertions, 4 deletions
diff --git a/contrib/completion/git-completion.zsh b/contrib/completion/git-completion.zsh
index 858864f..22d8e58 100644
--- a/contrib/completion/git-completion.zsh
+++ b/contrib/completion/git-completion.zsh
@@ -235,10 +235,13 @@ __git_zsh_main ()
case $state in
(command)
- _alternative \
- 'alias-commands:alias:__git_zsh_cmd_alias' \
- 'common-commands:common:__git_zsh_cmd_common' \
- 'all-commands:all:__git_zsh_cmd_all' && _ret=0
+ _tags common-commands alias-commands all-commands
+ while _tags; do
+ _requested common-commands && __git_zsh_cmd_common
+ _requested alias-commands && __git_zsh_cmd_alias
+ _requested all-commands && __git_zsh_cmd_all
+ let _ret || break
+ done
;;
(arg)
local command="${words[1]}" __git_dir