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

Re: starting completions with =,<,>



On Sun, 25 Jul 2004, chris s wrote:

> Hi, I'm trying to add to the functionality of the emerge completion for
> gentoo linux. For example,
> 
> emerge -p =zsh-4.2.0-r1

Unless you "unsetopt equals" this could potentially be expanded into

emerge -p /usr/local/bin/zsh-4.2.0-r1

(or the like).  That's why there's the "-equals-" completion context.

> I saw in the manpage that _values does not support the equal sign.

Can you quote the bits of the manual that made you think this?

In any event I don't think you want _values.  The _values function is for
words of the form <name><sep><value> where <sep> defaults to "=", e.g.
"foo=bar" (like an assignment).  You can tell it to use a different <sep>,
but in the case of emerge there doesn't appear to be a <name> part.

> '--exact[specify exact version]:*::alt:->exact_ver' 
> 
> This is what I'd rather have look like this:
> 
> '=[specify exact version]:*::alt:->exact_ver' 

The problem here is that you're trying to treat this as an option, when 
what you need to do is treat it as an argument.  The question is whether 
it is a stand-alone argument, or whether it's an argument that must follow 
the -p option?  I haven't been able to dig up any documentation on emerge 
(the only software I can find are a mass-mailing program and the emacs CVS 
interface -- everything else is lost in the Google noise because "emerge" 
is a real word).



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