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

Re: Redirection completion

Sven Wischnowsky wrote:
> So, I wrote the patch below.  Removing the -T stuff and consistently
> using names like `-value-foo' or `-redirect-echo-2>' everywhere, both
> for the context used for styles and for compdef/#compdef (that's why
> we don't need separated sets of completion functions anymore).

This makes a lot of sense.  I haven't quite understood how this system
handles the difference between `-redirect-2>' and `-redirect-echo-2>'.
Suppose I defined a redirection for the former, will I still get a
context including `-redirect-echo-2>'?  And is that the same for a plain
`-redirect-'?  I would guess yes, since the context depends on what you
are completing rather than what function is doing it (and patterns are a
more natural part of styles than of compdef definitions).

The only worry is that someone, somewhere will decide it's a great idea
to have commands beginning with `-' for some special use.  I don't see
how we can guard against that in general, though.  We can't make the
current set of completion functions indendent of the choice of
character.  We may just as well stick with -.  Maybe we could allow it
to be escaped, like `:' (often) can be.

Peter Stephenson <pws@xxxxxxx>                  Software Engineer
CSR Ltd., Science Park, Milton Road,
Cambridge, CB4 0WH, UK                          Tel: +44 (0)1223 392070

The information transmitted is intended only for the person or
entity to which it is addressed and may contain confidential 
and/or privileged material. 
Any review, retransmission, dissemination or other use of, or
taking of any action in reliance upon, this information by 
persons or entities other than the intended recipient is 
If you received this in error, please contact the sender and 
delete the material from any computer.

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