From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14653 invoked from network); 28 Jun 2000 13:13:14 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 28 Jun 2000 13:13:14 -0000 Received: (qmail 4640 invoked by alias); 28 Jun 2000 13:12:52 -0000 Mailing-List: contact zsh-users-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 3225 Received: (qmail 4632 invoked from network); 28 Jun 2000 13:12:52 -0000 Date: Wed, 28 Jun 2000 15:12:45 +0200 (MET DST) Message-Id: <200006281312.PAA32564@beta.informatik.hu-berlin.de> From: Sven Wischnowsky To: zsh-users@sunsite.auc.dk In-reply-to: Matthias Kopfermann's message of Wed, 28 Jun 2000 15:02:34 +0200 Subject: Re: --help trough _use_lo , but how with -h style? 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@informatik.hu-berlin.de