Skip to content

Commit 9d76052

Browse files
felipecgitster
authored andcommitted
completion: zsh: improve command tags
There's no need to use _alternative and repeat a lot of the code. Signed-off-by: Felipe Contreras <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 9a397ea commit 9d76052

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

contrib/completion/git-completion.zsh

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -235,10 +235,13 @@ __git_zsh_main ()
235235

236236
case $state in
237237
(command)
238-
_alternative \
239-
'alias-commands:alias:__git_zsh_cmd_alias' \
240-
'common-commands:common:__git_zsh_cmd_common' \
241-
'all-commands:all:__git_zsh_cmd_all' && _ret=0
238+
_tags common-commands alias-commands all-commands
239+
while _tags; do
240+
_requested common-commands && __git_zsh_cmd_common
241+
_requested alias-commands && __git_zsh_cmd_alias
242+
_requested all-commands && __git_zsh_cmd_all
243+
let _ret || break
244+
done
242245
;;
243246
(arg)
244247
local command="${words[1]}" __git_dir

0 commit comments

Comments
 (0)