From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16708 invoked from network); 23 May 2000 13:50:27 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 23 May 2000 13:50:27 -0000 Received: (qmail 20228 invoked by alias); 23 May 2000 13:50:16 -0000 Mailing-List: contact zsh-workers-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 11531 Received: (qmail 20221 invoked from network); 23 May 2000 13:50:15 -0000 Message-ID: <392A8C8C.4EBEF343@u.genie.co.uk> Date: Tue, 23 May 2000 14:50:04 +0100 From: Oliver Kiddle X-Mailer: Mozilla 4.73 [en] (Win95; I) X-Accept-Language: en MIME-Version: 1.0 To: zsh-workers@sunsite.auc.dk Subject: Re: PATCH: Re: _netscape References: <200005231315.PAA24546@beta.informatik.hu-berlin.de> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sven Wischnowsky wrote: > > > Basically, what a helper function needs to do is > > > take the suffix passed to it and when it is completing a final component > > > of itself, it should pass any suffix it wants with the one passed to it > > > appended. Pulling out -S options from "$@" is going to look messy > > > without some special handling at a lower level somewhere. > This is so simple to write that I think it's worth adding. So, this > adds the -E option to zparseopts that can be used to extract options > from the positional parameters. When combined with -D, the options > described are actually removed from $*. On the basis that compadd does only use the first -S option that it is passed, being able to remove an option is not what is wanted: what is wanted is a way to separate the first -S option and have it available in a parameter. If a helper function is completing only an initial portion of whatever it completes, it is likely that what it needs to do is use its own suffix, ignoring any passed to it - this we can do by inserting a new -S option before the passed args. But, if a helper function is completing the final portion of whatever it completes, it might want to use as a suffix, the concatenation of its own suffix with the one which was passed to it. For this, it would need to extract any suffix passed to it as opposed to remove it. I'll also need to think about what will happen with -r options aswell. This -E option well be very useful as it is but it is not quite what I meant by 'pull out -S options from "$@"'. Oliver