From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29167 invoked from network); 3 Sep 2004 15:33:03 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 3 Sep 2004 15:33:03 -0000 Received: (qmail 39222 invoked from network); 3 Sep 2004 15:32:58 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 3 Sep 2004 15:32:58 -0000 Received: (qmail 2581 invoked by alias); 3 Sep 2004 15:32:24 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 20313 Received: (qmail 2568 invoked from network); 3 Sep 2004 15:32:23 -0000 Received: from unknown (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 3 Sep 2004 15:32:23 -0000 Received: (qmail 37540 invoked from network); 3 Sep 2004 15:31:25 -0000 Received: from acolyte.scowler.net (216.254.112.45) by a.mx.sunsite.dk with SMTP; 3 Sep 2004 15:31:24 -0000 Received: by acolyte.scowler.net (Postfix, from userid 1000) id 30F0B7004A; Fri, 3 Sep 2004 11:31:25 -0400 (EDT) Date: Fri, 3 Sep 2004 11:31:25 -0400 From: Clint Adams To: zsh-workers@sunsite.dk Cc: 269769@bugs.debian.org Subject: Re: [vincent@vinc17.org: Bug#269769: zsh: sabcmd completion doesn't work] Message-ID: <20040903153125.GA29748@scowler.net> References: <20040903140238.GB27525@scowler.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.6+20040722i X-Spam-Checker-Version: SpamAssassin 2.63 on a.mx.sunsite.dk X-Spam-Level: X-Spam-Status: No, hits=-0.9 required=6.0 tests=BAYES_10 autolearn=no version=2.63 X-Spam-Hits: -0.9 > schaefer<690> sabcmd > Completing parameter name - > Completing stylesheet - > file1.xsl > > I don't immediately know why an empty group is being created for parameter > names even when there are no parameters to be completed. That's odd. Judging by the manpage, it looks as though the stylesheet should always be the first non-option argument, and the valid name=value assignments need to be parsed from that. I'm tempted to do the following. Index: Completion/Unix/Command/_sablotron =================================================================== RCS file: /cvsroot/zsh/zsh/Completion/Unix/Command/_sablotron,v retrieving revision 1.2 diff -u -r1.2 _sablotron --- Completion/Unix/Command/_sablotron 21 Jan 2004 13:53:29 -0000 1.2 +++ Completion/Unix/Command/_sablotron 3 Sep 2004 15:29:49 -0000 @@ -15,38 +15,4 @@ $mopts{-c,--chain-xsl}'[single input file, multiple chained stylesheets]' \ $mopts{-x,--batch-xml}'[single input file, multiple stylesheets]' \ $mopts{-s,--batch-xsl}'[multiple input files, single stylesheet]' \ - '*: :->arguments' && ret=0 - -if [[ -n "$state" ]]; then - mode="${opt_args[(i)-c|--chain-xsl]:+chain}${opt_args[(i)-x|--batch-xml]:+batch-x}${opt_args[(i)-s|--batch-xsl]:+batch-s}" - [[ $mode = (chain|batch-[xs]) ]] || mode=default - _tags assignments files - while _tags; do - if _requested assignments; then - if [[ -prefix *= ]]; then - _message -e value value - else - _message -e parameter 'parameter name' - fi - fi - if _requested files; then - case $mode:${#words[1,CURRENT-1]:#(-*|*=*)}; in - default:1|chain:<3->|batch-x:2|batch-s:1) - _description files expl stylesheet - _files "$expl[@]" -g "*.xsl(-.)" && ret=0 - ;; - default:2|chain:1|batch-x:1|batch-s:2) - _description files expl 'input file' - _files "$expl[@]" && ret=0 - ;; - default:3|chain:2|batch-x:<3->|batch-s:<3->) - _description files expl 'output file' - _files "$expl[@]" && ret=0 - ;; - esac - fi - (( ret )) || break - done -fi - -return ret + ':::_files -g "*.xsl"' && ret=0