From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9290 invoked from network); 8 Mar 2007 04:29:03 -0000 X-Spam-Checker-Version: SpamAssassin 3.1.8 (2007-02-13) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=BAYES_00,FORGED_RCVD_HELO autolearn=ham version=3.1.8 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 8 Mar 2007 04:29:03 -0000 Received-SPF: none (ns1.primenet.com.au: domain at sunsite.dk does not designate permitted sender hosts) Received: (qmail 71927 invoked from network); 8 Mar 2007 04:28:57 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 8 Mar 2007 04:28:57 -0000 Received: (qmail 25633 invoked by alias); 8 Mar 2007 04:28:55 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 23206 Received: (qmail 25623 invoked from network); 8 Mar 2007 04:28:54 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 8 Mar 2007 04:28:54 -0000 Received: (qmail 71644 invoked from network); 8 Mar 2007 04:28:54 -0000 Received: from acolyte.scowler.net (216.254.112.45) by a.mx.sunsite.dk with SMTP; 8 Mar 2007 04:28:51 -0000 Received: by acolyte.scowler.net (Postfix, from userid 1000) id 4A2FC5C06B; Wed, 7 Mar 2007 23:28:49 -0500 (EST) Date: Wed, 7 Mar 2007 23:28:49 -0500 From: Clint Adams To: zsh-workers@sunsite.dk Subject: PATCH: _mercurial Message-ID: <20070308042849.GA15611@scowler.net> Mail-Followup-To: zsh-workers@sunsite.dk MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.13 (2006-08-11) Here's wondering if someone will reply with a more comprehensive completion function. Index: Completion/Unix/Command/_mercurial =================================================================== RCS file: Completion/Unix/Command/_mercurial diff -N Completion/Unix/Command/_mercurial --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ Completion/Unix/Command/_mercurial 8 Mar 2007 04:26:19 -0000 @@ -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