From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26206 invoked from network); 21 Jan 2006 04:10:51 -0000 X-Spam-Checker-Version: SpamAssassin 3.1.0 (2005-09-13) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00, FORGED_RCVD_HELO autolearn=ham version=3.1.0 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 21 Jan 2006 04:10:51 -0000 Received: (qmail 39847 invoked from network); 21 Jan 2006 04:10:44 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 21 Jan 2006 04:10:44 -0000 Received: (qmail 23404 invoked by alias); 21 Jan 2006 04:10:38 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 22168 Received: (qmail 23393 invoked from network); 21 Jan 2006 04:10:38 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 21 Jan 2006 04:10:38 -0000 Received: (qmail 39225 invoked from network); 21 Jan 2006 04:10:38 -0000 Received: from acolyte.scowler.net (216.254.112.45) by a.mx.sunsite.dk with SMTP; 21 Jan 2006 04:10:37 -0000 Received: by acolyte.scowler.net (Postfix, from userid 1000) id D976E70055; Fri, 20 Jan 2006 23:10:35 -0500 (EST) Date: Fri, 20 Jan 2006 23:10:35 -0500 From: Clint Adams To: zsh-workers@sunsite.dk Subject: PATCH: _bts (options and such) Message-ID: <20060121041035.GA10305@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.11 This is much less useless than 22166. I think it's only missing subcommand handling for cache and cleancache, which look to be mini-nightmares. Index: Completion/Debian/Command/_bts =================================================================== RCS file: /cvsroot/zsh/zsh/Completion/Debian/Command/_bts,v retrieving revision 1.5 diff -u -r1.5 _bts --- Completion/Debian/Command/_bts 21 Jan 2006 01:52:10 -0000 1.5 +++ Completion/Debian/Command/_bts 21 Jan 2006 04:06:44 -0000 @@ -1,19 +1,36 @@ #compdef bts -local expl +local expl first=1 -compset -N '[,.]' || compset -n 2 +_arguments -A "-*" \ + '(-o --offline)'{-o,--offline}'[use cached bugs]' \ + '(--online --no-offline)'{--online,--no-offline}'[do not use cached bugs]' \ + '(--cache --no-cache)--cache[cache new versions of pages]' \ + '(--cache --no-cache)--no-cache[do not cache new versions of pages]' \ + '--cache-mode=:cache mode:(min mbox full)' \ + '--cache-delay=:seconds:' \ + '--mbox[open a mail reader to read the corresponding mbox]' \ + '--mailreader=:reader:' \ + '(-f --force-refresh)'{-f,--force-refresh}'[download bug report even if unchanged]' \ + '-no-force-refresh[do not force refresh]' \ + '(-q --quiet)*'{-q,--quiet}'[only display info about newly cached pages]' \ + '(--no-conf --noconf)*'{--no-conf,--noconf}'[do not read any config files]' \ + '*:subcommand and args:->subcmds' && return 0 + +compset -N '-[^0-9]#' && first=0 +compset -N '[,.]' && first=0 +[[ $first -eq 0 ]] || compset -n 2 if [[ CURRENT -eq 1 ]]; then _wanted cmd expl 'bts command' compadd show bugs close reopen retitle \ reassign merge unmerge tag severity forwarded notforwarded help \ - clone submitter found notfound block unblock user usertag \ + clone submitter found notfound block unblock user usertag usertags \ package owner noowner reportspam cache cleancache return fi case "$words[1]" in - show|close|unmerge|notforwarded) + (show|close|unmerge|notforwarded|noowner|reportspam) if [[ CURRENT -eq 2 ]]; then _message -e bugnum 'bug number' else @@ -99,6 +116,71 @@ _wanted sep expl 'separator' compadd -S ' ' , . fi ;; + (clone) + if [[ CURRENT -eq 2 ]]; then + _message -e bugnum 'bug number' + elif [[ CURRENT -eq 3 || -prefix [-] ]]; then + _wanted newid expl 'new ID' compadd -- -{1..9} + else + _wanted sep expl 'separator' compadd -S ' ' , . + fi + ;; + (submitter|owner) + if [[ CURRENT -eq 2 ]]; then + _message -e bugnum 'bug number' + else + _alternative \ + 'bugnum:bug number:' \ + 'email:email address:_email_addresses -c' \ + 'bang:bang:compadd \!' + fi + ;; + (found|notfound) + if [[ CURRENT -eq 2 ]]; then + _message -e bugnum 'bug number' + elif [[ CURRENT -eq 3 ]]; then + _message -e version 'version' + else + _wanted sep expl 'separator' compadd -S ' ' , . + fi + ;; + (block|unblock) + if [[ CURRENT -eq 2 ]]; then + _message -e bugnum 'bug number' + elif [[ CURRENT -eq 3 ]]; then + _wanted prep expl 'preposition' compadd by with + else + _alternative \ + 'bugnum:bug number:' \ + 'separator:separator:compadd -S " " , .' + fi + ;; + (user) + if [[ CURRENT -eq 2 ]]; then + _wanted upstream expl 'user email for usertags' _email_addresses -c + else + _wanted sep expl 'separator' compadd -S ' ' , . + fi + ;; + (usertags#) + if [[ CURRENT -eq 2 ]]; then + _message -e bugnum 'bug number' + elif [[ CURRENT -eq 3 ]]; then + _wanted operator expl 'operator' compadd - '+' '-' '=' + elif [[ CURRENT -eq 4 ]]; then + _message -e usertag 'user tag' + else + _message -e usertag 'user tag' + _wanted sep expl 'separator' compadd -S ' ' , . + fi + ;; + (package) + if [[ CURRENT -eq 2 ]]; then + _wanted package expl 'package' _deb_packages avail + else + _wanted sep expl 'separator' compadd -S ' ' , . + fi + ;; help) ;& *) _wanted sep expl 'separator' compadd -S ' ' , .