Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: _arguments: repeated option with multiple optargs



Roman Neuhauser wrote:
>     That reminds me: the message part of optarg must not be empty,
>     otherwise I get no completions, is that a bug?

Generally two colons together mean special things.  It should work if
there's at least a space, otherwise it's certainly a bug.

>     I looked inside _arguments, it contains (4.2.5) 10 calls to
>     comparguments, but zsh/computil is basically undocumented with the
>     excuse that it's "not very interesting" to users. Funny.

Yes, that's a real nuisance in working out what's going on.

>     Thinking some more... In "tence -r file t1 <CURSOR>", _complete_help
>     says the $context is ":completion::complete:tence::option-r-rest:".
>     How can I access the value from inside my completion function? I
>     thought I saw this info somewhere, but cannot find it.  I'd like to
>     see what happens if I change the argument member from option-r-rest
>     to "" before the call to _arguments, IFF $words[$CURRENT] is "-".

You need to manipulate curcontext.  The usual idiom is

local curcontext="${curcontext}:extra:bits"

or something.

>     BTW, you sent this only to me. Was that intentional?

No, I passed on the mail to the list (and this one, too).

-- 
Peter Stephenson <pws@xxxxxxx>                  Software Engineer
CSR PLC, Churchill House, Cambridge Business Park, Cowley Road
Cambridge, CB4 0WZ, UK                          Tel: +44 (0)1223 692070


To access the latest news from CSR copy this link into a web browser:  http://www.csr.com/email_sig.php



Messages sorted by: Reverse Date, Date, Thread, Author