From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16804 invoked from network); 23 May 2000 14:00:08 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 23 May 2000 14:00:08 -0000 Received: (qmail 21490 invoked by alias); 23 May 2000 14:00:00 -0000 Mailing-List: contact zsh-workers-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 11532 Received: (qmail 21482 invoked from network); 23 May 2000 13:59:58 -0000 Date: Tue, 23 May 2000 15:58:41 +0200 (MET DST) Message-Id: <200005231358.PAA25220@beta.informatik.hu-berlin.de> From: Sven Wischnowsky To: zsh-workers@sunsite.auc.dk In-reply-to: Oliver Kiddle's message of Tue, 23 May 2000 14:50:04 +0100 Subject: Re: PATCH: Re: _netscape Oliver Kiddle wrote: > 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. Ever had a look at zparseopts? foo() { local suffix zparseopts -D -E 'S:=suffix' print "user-supplied suffix: ${suffix:-}" print "remaining arguments: $*" } % foo -J group -S test -X format other arguments user-supplied suffix: -S test remaining arguments: -J group -X format other arguments % foo -J group -X format no suffix here user-supplied suffix: remaining arguments: -J group -X format no suffix here What else do you need? Bye Sven -- Sven Wischnowsky wischnow@informatik.hu-berlin.de