From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4134 invoked from network); 10 May 2000 07:41:55 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 10 May 2000 07:41:55 -0000 Received: (qmail 23894 invoked by alias); 10 May 2000 07:41:38 -0000 Mailing-List: contact zsh-workers-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 11291 Received: (qmail 23806 invoked from network); 10 May 2000 07:41:34 -0000 To: zsh-workers@sunsite.auc.dk Subject: _arguments problems MIME-Version: 1.0 (generated by SEMI 1.13.7 - "Awazu") Content-Type: text/plain; charset=US-ASCII From: Tanaka Akira Date: 10 May 2000 16:42:40 +0900 Message-ID: User-Agent: T-gnus/6.14.1 (based on Gnus v5.8.3) (revision 16) SEMI/1.13.7 (Awazu) FLIM/1.13.2 (Kasanui) Emacs/20.6 (i686-pc-linux-gnu) MULE/4.0 (HANANOEN) I re-read the item of _arguments in zshcompsys(1) and found some problems. (and wrote BNF for a personal reference.) Z(4):akr@serein% Src/zsh -f serein% bindkey -e; autoload -U compinit; compinit -D; compdef _tst tst (1) serein% _tst () { _arguments '-o:*a:a:(a)' ':A:(A)' ':B:(B)' } serein% tst A -o a -> serein% tst A -o a _tags:comptags:83: no tags registered serein% tst A -o a _tags:comptags:83: no tags registered serein% tst A -o a (2) serein% _tst () { _arguments '-e:*last:::b:{compadd "${(j:,:)words}"}' } serein% tst -e last xxx serein% tst -e ,last,xxx last xxx $words shouldn't have `xxx'. (3) The explanation of the example `(-foo):...' is wrong. ... in the second example the argument described by the specification will not be offered if the option -foo is on the line. I think it's reverted. (4) serein% _tst () { _arguments '(*)-x' ':a:(a)' } serein% tst -x -> serein% tst -x a Hm. What's excluded by `*'? (5) serein% _tst () { _arguments '*-z:o:(o)' ':a:{compadd $opt_args[-z]}' } serein% tst -z a -z b -> serein% tst -z a -z b b It should be `a:b' (6) serein% _tst () { _arguments '*-o:1:(1):*:rest:{compadd $curcontext}' } serein% tst -o 1 serein% tst -o 1 :complete:tst:option-o-2 :complete:tst:option-o-2 This is the behaviour which is described in zshcompsys(1). But I think it should be :complete:tst:option-o-rest (7) serein% _tst () { _arguments '*-o:1:(1):*:rest:{compadd $context}' } serein% tst -o 1 It completes nothing. context parameter is not set? -- Tanaka Akira