From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4210 invoked from network); 14 Mar 2000 13:22:25 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 14 Mar 2000 13:22:25 -0000 Received: (qmail 26313 invoked by alias); 14 Mar 2000 13:22:12 -0000 Mailing-List: contact zsh-workers-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 10133 Received: (qmail 26300 invoked from network); 14 Mar 2000 13:22:11 -0000 Message-ID: <38CE3CF3.C8CA88A0@u.genie.co.uk> Date: Tue, 14 Mar 2000 13:21:55 +0000 From: Oliver Kiddle X-Mailer: Mozilla 4.72 [en] (Win95; I) X-Accept-Language: en MIME-Version: 1.0 To: Zsh workers Subject: Re: Saving the zle display stuff References: <200003130922.KAA14988@beta.informatik.hu-berlin.de> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sven Wischnowsky wrote: > > > > Is there a better way for me to have done the equivalent of :*:nothing:_nothing for the -r option? > > > > > > Can't think of a better way... never thought about that. Hm. Is it > > > worth to make _arguments support this directly, i.e. add a syntax > > > saying: `no more arguments after this option'? > > > > There's probably quite a lot of commands like zpty where they can be > > used in a few separate ways (each with their own set of arguments) and > > for these commands it is useful to avoid the final arguments for some > > forms so if it is fairly simple to do and there is a clear way of > > representing it in the _arguments parameters then it is probably worth > > doing. > > Any suggestions for the syntax? (A trailing colon with no description > after it?) That would be fine. An alternative which might be worth thinking about is to allow all lines in _arguments to specify a list of options with which they are mutually exclusive. So in the vase of _zpty, I would use: '(-r)*::args:_normal' as the last line. I think this might be more useful. For example consider the case of AIX's lsvg command for which I recently wrote a completion function. It's syntax is of the following form: Usage: lsvg [-o] [-n PVname] lsvg [-i] [-M|-l|-p] VGname... So basically it has two different forms. The trouble is that I can't use my _nothing trick for -o or -n because I might want to complete a -n option after a -o option or vice-versa. It worked for zpty's -r option because -r can only be used on its own. What I would like to do for lsvg is to use something like: '(-o -n)*:volume groups:_volume_groups' for the last line. I seem to have some fairly long option exclusion lists in some of my completions so it might also be worth thinking if there are any better ways of doing the completion when there are separate forms of the command. I experimented with a few things like using two calls to _arguments without much success. Oliver