Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: --help trough _use_lo , but how with -h style?
- X-seq: zsh-users 3225
- From: Sven Wischnowsky <wischnow@xxxxxxxxxxxxxxxxxxxxxxx>
- To: zsh-users@xxxxxxxxxxxxxx
- Subject: Re: --help trough _use_lo , but how with -h style?
- Date: Wed, 28 Jun 2000 15:12:45 +0200 (MET DST)
- In-reply-to: Matthias Kopfermann's message of Wed, 28 Jun 2000 15:02:34 +0200
- Mailing-list: contact zsh-users-help@xxxxxxxxxxxxxx; run by ezmlm
Matthias Kopfermann wrote:
> Hi again,
> After I got the information about the use of `compdef _use_lo x y z' to
> have x y and z commands completed I asked myself:
> How can i do it with these `-h' commands. e.g. mutt only wants
> -x flags. i would like to have such commands being completed just
> like the much nicer to read --x commands. is there a function
> already for these kind of commands? (I am not talking about a
> specific mutt completion though that may be nice, too.)
>
> BTW: i used to use perl for having --help commands being
> completed and i have a function that does it with -h commands ,
> too, but it would be much nicer, if there was such a function in
> plain-zsh already. Thats why i ask.
No, we don't have that yet. But we have a completion function for mutt.
Hm, if you have a function to generate the option names you can easily
use that. I guess the function puts the options into the $reply array
(I'll assume the strings generated include the `-'), so you can do:
_use_so() { # ;-)
if [[ $PREFIX = -* ]]; then
... # call perl-function-thingy
compadd -a reply
else
_default
fi
}
To make this nicer, change the `compadd'-line to:
local expl
_wanted options expl option compadd -a reply
Bye
Sven
--
Sven Wischnowsky wischnow@xxxxxxxxxxxxxxxxxxxxxxx
Messages sorted by:
Reverse Date,
Date,
Thread,
Author