From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20941 invoked from network); 13 Jun 2007 15:36:48 -0000 X-Spam-Checker-Version: SpamAssassin 3.2.1 (2007-05-02) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.1 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 13 Jun 2007 15:36:48 -0000 Received-SPF: none (ns1.primenet.com.au: domain at sunsite.dk does not designate permitted sender hosts) Received: (qmail 73708 invoked from network); 13 Jun 2007 15:36:42 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 13 Jun 2007 15:36:42 -0000 Received: (qmail 16947 invoked by alias); 13 Jun 2007 15:36:39 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 23556 Received: (qmail 16936 invoked from network); 13 Jun 2007 15:36:38 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 13 Jun 2007 15:36:38 -0000 Received: (qmail 73329 invoked from network); 13 Jun 2007 15:36:38 -0000 Received: from acolyte.scowler.net (216.254.112.45) by a.mx.sunsite.dk with SMTP; 13 Jun 2007 15:36:35 -0000 Received: by acolyte.scowler.net (Postfix, from userid 1000) id 402905C3C6; Wed, 13 Jun 2007 11:36:34 -0400 (EDT) Date: Wed, 13 Jun 2007 11:36:34 -0400 From: Clint Adams To: zsh-workers@sunsite.dk Subject: PATCH: _rrdtool Message-ID: <20070613153634.GA22900@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) Might be worth parsing rrdtool help output. Index: Completion/Unix/Command/_rrdtool =================================================================== RCS file: Completion/Unix/Command/_rrdtool diff -N Completion/Unix/Command/_rrdtool --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ Completion/Unix/Command/_rrdtool 13 Jun 2007 15:35:27 -0000 @@ -0,0 +1,23 @@ +#compdef rrdtool + +_arguments \ + ':rrdtool command:(create update updatev graph dump restore + last lastupdate first help info fetch tune + resize xport)' \ + '*::subcmd:->subcmd' && return 0 + +case "$state" in + (subcmd) + + case "$words[1]" in + (help) + _wanted -V 'subcommands' expl 'subcommand' compadd \ + create update updatev graph dump restore last lastupdate \ + first help info fetch tune resize xport + ;; + (*) + _files + ;; + esac + ;; +esac