From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 701 invoked from network); 23 Jul 2005 14:09:37 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 23 Jul 2005 14:09:37 -0000 Received: (qmail 71125 invoked from network); 23 Jul 2005 14:09:31 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 23 Jul 2005 14:09:31 -0000 Received: (qmail 23744 invoked by alias); 23 Jul 2005 14:09:29 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 21505 Received: (qmail 23731 invoked from network); 23 Jul 2005 14:09:29 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 23 Jul 2005 14:09:29 -0000 Received: (qmail 70819 invoked from network); 23 Jul 2005 14:09:29 -0000 Received: from acolyte.scowler.net (216.254.112.45) by a.mx.sunsite.dk with SMTP; 23 Jul 2005 14:09:23 -0000 Received: by acolyte.scowler.net (Postfix, from userid 1000) id 2FD3670055; Sat, 23 Jul 2005 10:09:23 -0400 (EDT) Date: Sat, 23 Jul 2005 10:09:23 -0400 From: Clint Adams To: zsh-workers@sunsite.dk Subject: PATCH: _rubber cleanup part 1 Message-ID: <20050723140923.GA8888@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.9i X-Spam-Checker-Version: SpamAssassin 3.0.4 (2005-06-05) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00 autolearn=ham version=3.0.4 Use array instead of function. Index: Completion/Unix/Command/_rubber =================================================================== RCS file: /cvsroot/zsh/zsh/Completion/Unix/Command/_rubber,v retrieving revision 1.1 diff -u -r1.1 _rubber --- Completion/Unix/Command/_rubber 12 Jul 2005 12:30:20 -0000 1.1 +++ Completion/Unix/Command/_rubber 23 Jul 2005 14:07:57 -0000 @@ -1,6 +1,6 @@ #compdef rubber rubber-pipe rubber-info -local _rubber_version _rubber_path _rubber_modules +local _rubber_version _rubber_path _rubber_modules _rubber_args eval $(rubber --version | sed 's/^.* \([^ ]*\): */_rubber_\1=/') if [[ ${_rubber_version#0} != $_rubber_version ]]; then @@ -14,31 +14,31 @@ ) fi -_rubber_arguments () { - _arguments -s \ - \*{-c,--command}'=[run the directive CMD before parsing]:command' \ - \*{-e,--epilogue}'=[run the directive CMD after parsing]:command' \ - {-z,--gzip}'[compress the final document]' \ - '(- *)'{-h,--help}'[show help]' \ - '--into=[go to directory DIR before compiling]:directory:_files -/' \ - {-l,--landscape}'[change paper orientation (if relevant)]' \ - {-n,--maxerr}'=[display at most NUM errors]:num' \ - \*{-m,--module}'=[use module]:module:($_rubber_modules)' \ - '--only=[only include the specified SOURCES]:sources' \ - \*{-o,--post}'=[postprocess with module]:postprocessor:($_rubber_modules)' \ - {-d,--pdf}'[produce PDF output instead of DVI]' \ - {-p,--ps}'[produce a PostScript document]' \ - {-q,--quiet}'[suppress messages]' \ - \*{-r,--read}'[read additional directives from a file]:directives files:_files' \ - {-s,--short}'[display errors in a compact form]' \ - \*{-I,--texpath}'=[add DIR to the search path for LaTeX]:tex path:_files -/' \ - \*{-v,--verbose}'[increase verbosity]' \ - '--version[print version information and exit]' "$@" -} +_rubber_args=( + \*{-c,--command}'=[run the directive CMD before parsing]:command' + \*{-e,--epilogue}'=[run the directive CMD after parsing]:command' + {-z,--gzip}'[compress the final document]' + '(- *)'{-h,--help}'[show help]' + '--into=[go to directory DIR before compiling]:directory:_files -/' + {-l,--landscape}'[change paper orientation (if relevant)]' + {-n,--maxerr}'=[display at most NUM errors]:num' + \*{-m,--module}'=[use module]:module:($_rubber_modules)' + '--only=[only include the specified SOURCES]:sources' + \*{-o,--post}'=[postprocess with module]:postprocessor:($_rubber_modules)' + {-d,--pdf}'[produce PDF output instead of DVI]' + {-p,--ps}'[produce a PostScript document]' + {-q,--quiet}'[suppress messages]' + \*{-r,--read}'[read additional directives from a file]:directives files:_files' + {-s,--short}'[display errors in a compact form]' + \*{-I,--texpath}'=[add DIR to the search path for LaTeX]:tex path:_files -/' + \*{-v,--verbose}'[increase verbosity]' + '--version[print version information and exit]' +) case "$service" in rubber) - _rubber_arguments \ + _arguments -s \ + "$_rubber_args[@]" \ '--clean[remove produced files instead of compiling]' \ {-f,--force}'[force at least one compilation]' \ '--inplace[compile the documents from their source directory]' \ @@ -48,14 +48,16 @@ ;; rubber-pipe) - _rubber_arguments \ + _arguments -s \ + "$_rubber_args[@]" \ {-k,--keep}'[keep the temporary files after compiling]' \ \*{-W,--warn}'=[report warnings of the given TYPE]:warnings:(all boxes misc refs)' return 0 ;; rubber-info) - _rubber_arguments \ + _arguments -s \ + "$_rubber_args[@]" \ '--boxes[report overfull and underfull boxes]' \ '--check[report errors or warnings default action]' \ '--deps[show the target file s dependencies]' \