1
0
Fork 0
mirror of git://git.code.sf.net/p/zsh/code synced 2025-01-19 11:31:26 +01:00
zsh/Completion/Unix/Command/_mercurial
2007-11-12 04:02:58 +00:00

27 lines
517 B
Text

#compdef hg
local context state line
typeset -A opt_args
if (( ! $+_mercurial_cmds )); then
local _mercurial_cmds
_mercurial_cmds=( $($service debugcomplete) )
fi
if (( ! $+_mercurial_options )); then
local _mercurial_options
_mercurial_options=( $($service debugcomplete --options) )
fi
_arguments \
"$_mercurial_options[@]" \
'*:command:->subcmds' && return 0
case "$state" in
(subcmds)
if (( CURRENT == 2 )); then
compadd -- "$_mercurial_cmds[@]"
else
_files
fi
;;
esac