From 363308f3df1510088c8253e09f1a7d2115f9515a Mon Sep 17 00:00:00 2001 From: Clint Adams Date: Thu, 8 Mar 2007 04:31:03 +0000 Subject: 23206: completion for hg. --- ChangeLog | 4 ++++ Completion/Unix/Command/_mercurial | 27 +++++++++++++++++++++++++++ 2 files changed, 31 insertions(+) create mode 100644 Completion/Unix/Command/_mercurial diff --git a/ChangeLog b/ChangeLog index bcf61fc5d..6aadca475 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2007-03-08 Clint Adams + + * 23206: Completion/Unix/Commands/_mercurial: completion for hg. + 2007-03-05 Clint Adams * 23205: Doc/Zsh/options.yo: fix misspelling of "effect". 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 -- cgit 1.4.1