Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: optional argument?
- X-seq: zsh-workers 10819
- From: Sven Wischnowsky <wischnow@xxxxxxxxxxxxxxxxxxxxxxx>
- To: zsh-workers@xxxxxxxxxxxxxx
- Subject: Re: optional argument?
- Date: Wed, 19 Apr 2000 10:00:05 +0200 (MET DST)
- In-reply-to: Tanaka Akira's message of 19 Apr 2000 16:12:58 +0900
- Mailing-list: contact zsh-workers-help@xxxxxxxxxxxxxx; run by ezmlm
Tanaka Akira wrote:
> I think `optional arguments' of _arguments doesn't work now.
>
> Z(4):akr@serein% Src/zsh -f
> serein% bindkey -e; autoload -U compinit; compinit -D
> serein% _tst () { _arguments '-o::optarg:(optarg)' ':arg1:(arg1)' }
> serein% compdef _tst tst
> serein% tst -o <TAB>
> ->
> serein% tst -o optarg
>
> If I understand correctly, this should completes `arg1' as well as
> `optarg'.
Hm, maybe it's time to change it...
Currently we only support completing options and the optional argument
at the same time.
The problem is the `->' case: _arguments can't `add' matches for more
than one `->state' because it doesn't add any of them.
This is also related to the other question we had for _arguments some
time ago: supporting different `modes' with different sets of options
and arguments. For that we would need this multi-action thing, too. I
then suggested to support multiple `->state' things by reporting (to
the function calling _arguments) strings of the form `state1-state2'.
Or maybe I didn't suggest it, only thought of it.
In that case we could also make _alternative support `->state's.
Hm, I'll have a peep at this at the weekend, but don't promise
anything... ;-}
Bye
Sven
--
Sven Wischnowsky wischnow@xxxxxxxxxxxxxxxxxxxxxxx
Messages sorted by:
Reverse Date,
Date,
Thread,
Author