From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21474 invoked by alias); 4 Dec 2011 22:59:15 -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: 29942 Received: (qmail 8610 invoked from network); 4 Dec 2011 22:59:14 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.6 required=5.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED,RCVD_IN_DNSWL_LOW, T_DKIM_INVALID autolearn=no version=3.3.2 Received-SPF: pass (ns1.primenet.com.au: SPF record at _spf.google.com designates 209.85.161.171 as permitted sender) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:from:date:message-id:subject:to:content-type; bh=pApQvjSlNAfa27A5xp8Okk2uOn4V6w5J5qsHKYZVC+4=; b=xgaRoXDAQPJ5zyO+jcuVLKZ2E7uX2txz02TDcITuJJSjM0qMOmwtkmDB3zR+dSALB/ bAXqQXQ/fVQIKp0B0hFFZ0Tx2rRUILakP/Rwtn3Vit7qcPYzZHBM17FnfCeItNNKlN1D YTpa9Iv+jmbZQMAm3n14bWcEUamWvjmW0LRMo= MIME-Version: 1.0 From: Richard Hartmann Date: Sun, 4 Dec 2011 23:51:13 +0100 Message-ID: Subject: _arguments for non-dashed parameters (or similar)? To: zsh workers Content-Type: text/plain; charset=UTF-8 Hi all, I am trying to extend my completion for vcsh[1] before I actually submit it to this list. The problem is that this syntax simply ignores completion functions which would feed data into the completion: #compdef vcsh _arguments \ ':subcommand:(( clone\:"clone from repo":(1 2) help\:"display help" delete\:"delete repo" enter\:"Enter repo; spawn new \$SHELL" init\:"init & clone from repo" list\:"list all repos" list-tracked\:"list all files tracked by vcsh" list-tracked-by\:"list files tracked by a repo" rename\:"rename repo" run\:"run command on repo" seed-gitignore\:"seed .gitignore.d/foo from git ls-files" setup\:"set up repo with recommended settings" \\:"Run git command directly" ))' whereas this syntax does not seem to allow non-dashed parameters: _arguments \ '-clone:clone from repo:(1 2)' \ 'help:"display help"' \ 'delete:"delete repo"' \ 'enter:"Enter repo; spawn new \$SHELL"' \ 'init:"init & clone from repo"' \ 'list:"list all repos"' \ 'list-tracked:"list all files tracked by vcsh"' \ 'list-tracked-by:"list files tracked by a repo"' \ 'rename:"rename repo"' \ 'run:"run command on repo"' \ 'seed-gitignore:"seed .gitignore.d/foo from git ls-files":(foo bar)' \ 'setup:"set up repo with recommended settings"' \ '\:"Run git command directly"' \ % vcsh _arguments:comparguments:312: invalid argument: clone:clone from repo:(1 2) % and this approach does not work, either: clone[:argargs]:(1 2) _arguments:comparguments:312: invalid argument: clone[clone from repo]:(1 2) _git, _subversion et all seem to simply check the non-dashed parameter by hand and then do the rest in custom functions. Is there any generic and clean way to do this? If there is not, would it be worthwhile to introduce a new function? Given the fact that more and more programs use non-dashed prosaic command styles, this "problem" is becoming worse, not better. Richard [1] https://github.com/RichiH/vcsh