diff options
author | Clint Adams <clint@users.sourceforge.net> | 2007-03-08 04:31:03 +0000 |
---|---|---|
committer | Clint Adams <clint@users.sourceforge.net> | 2007-03-08 04:31:03 +0000 |
commit | 363308f3df1510088c8253e09f1a7d2115f9515a (patch) | |
tree | 000f3cd7be11d95d50068623eb87d40ca583dcc4 /Completion/Unix/Command | |
parent | 335fcaa9c566e7e7f514c2e2f7ab000fb2fd38d8 (diff) | |
download | zsh-363308f3df1510088c8253e09f1a7d2115f9515a.tar.gz zsh-363308f3df1510088c8253e09f1a7d2115f9515a.tar.xz zsh-363308f3df1510088c8253e09f1a7d2115f9515a.zip |
23206: completion for hg.
Diffstat (limited to 'Completion/Unix/Command')
-rw-r--r-- | Completion/Unix/Command/_mercurial | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/Completion/Unix/Command/_mercurial b/Completion/Unix/Command/_mercurial new file mode 100644 index 000000000..06212314e --- /dev/null +++ b/Completion/Unix/Command/_mercurial @@ -0,0 +1,27 @@ +#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 |