From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2717 invoked by alias); 22 Mar 2010 03:39:04 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 27818 Received: (qmail 11336 invoked from network); 22 Mar 2010 03:39:02 -0000 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.5 Received-SPF: pass (ns1.primenet.com.au: SPF record at benizi.com designates 64.130.10.15 as permitted sender) Date: Sun, 21 Mar 2010 23:38:58 -0400 (EDT) From: "Benjamin R. Haskell" To: Zsh Workers Subject: [PATCH] _xargs: add many options Message-ID: User-Agent: Alpine 2.01 (LNX 1266 2009-07-14) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII This is a first pass at adding a lot of options that aren't present in xargs completion. Two questions, after which I'll rework this. 1. I suspect a lot of these are GNU-specific. Can someone point me to a good example of the use of _variant (sp?) for another command that has both GNU- and non-GNU completion? 2. The old parameters passed to _arguments were mainly of the form: '(-mutually_exclusive)-option:some help text:' \ I changed it so that the help text shows up... '(-mutually_exclusive)-option[some help text]::' \ but maybe I'm doing something wrong? What's the expected difference in behavior between an optspec of: -optname[explanation]:: vs. -optname:message: ? Best, Ben --- Completion/Unix/Command/_xargs | 24 ++++++++++++++---------- 1 files changed, 14 insertions(+), 10 deletions(-) diff --git a/Completion/Unix/Command/_xargs b/Completion/Unix/Command/_xargs index f727ed8..905aaba 100644 --- a/Completion/Unix/Command/_xargs +++ b/Completion/Unix/Command/_xargs @@ -1,15 +1,19 @@ #compdef xargs _arguments \ - '(-t)-p[prompt user for each command]' \ - '(-p)-t[verbose - echo each command]' \ - '-x[exit if max size exceeded]' \ - -{e-,E}':end-of-file string:' \ - '(-x -I)-i-:replacement string for lines:' \ - '(-x -i)-I:replacement string for lines:' \ - '(-n -L -x)-l-:number of input lines:' \ - '(-n -l)-L:number of input lines:' \ - '(-l -L)-n-:maximum number of arguments:' \ - '-s-:maximum command line length:' \ + '(-t --verbose)'{-p,--interactive}'[prompt user for each command]' \ + '(-p --interactive)'{-t,--verbose}'[verbose - echo each command]' \ + {-x,--exit}'[exit if max size exceeded]' \ + -{e-,E,-eof}'[end-of-file string]::' \ + '(-x -I)-i-[replacement string for lines]::' \ + '(-x -i)-I[replacement string for lines]::' \ + '(-n -L -x)-l-[number of input lines]::' \ + '(-n -l)-L[number of input lines]::' \ + '(-l -L)'{-n-,--max-args}'[maximum number of arguments]::' \ + {-s-,--max-chars}'[maximum command line length]::' \ + {-P-,--max-procs}'[maximum simultaneous processes]::' \ + '(-0 --null)'{-d-,--delimiter}'[terminate input items on the specified delimiter]::' \ + '(-d --delimiter)'{-0,--null}'[terminate input items on a null character]::' \ + {-r,--no-run-if-empty}'[do not run if there are no items]' \ '(-):command: _command_names -e' \ '*::args: _normal' -- 1.7.0