zsh-workers
 help / color / mirror / code / Atom feed
From: Tanaka Akira <akr@m17n.org>
To: zsh-workers@sunsite.auc.dk
Subject: _arguments problems
Date: 10 May 2000 16:42:40 +0900	[thread overview]
Message-ID: <hvoog6ekg0f.fsf@serein.m17n.org> (raw)

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 <TAB>
->
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 <TAB> 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 <TAB>
->
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 <TAB>
->
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 <TAB><TAB>
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 <TAB>

It completes nothing.  context parameter is not set?
-- 
Tanaka Akira


             reply	other threads:[~2000-05-10  7:41 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-05-10  7:42 Tanaka Akira [this message]
  -- strict thread matches above, loose matches on Subject: below --
2000-02-07  8:54 Sven Wischnowsky
2000-02-04  9:59 Sven Wischnowsky
2000-02-04 13:16 ` Tanaka Akira
2000-02-04 14:18 ` Sven Wischnowsky
2000-02-04 18:35   ` Bart Schaefer
2000-02-03 19:14 Tanaka Akira

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=hvoog6ekg0f.fsf@serein.m17n.org \
    --to=akr@m17n.org \
    --cc=zsh-workers@sunsite.auc.dk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).