zsh-workers
 help / color / mirror / code / Atom feed
From: Sven Wischnowsky <wischnow@informatik.hu-berlin.de>
To: zsh-workers@sunsite.auc.dk
Subject: Re: PATCH: Re: _netscape
Date: Tue, 23 May 2000 15:58:41 +0200 (MET DST)	[thread overview]
Message-ID: <200005231358.PAA25220@beta.informatik.hu-berlin.de> (raw)
In-Reply-To: Oliver Kiddle's message of Tue, 23 May 2000 14:50:04 +0100


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:-<none>}"
    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: <none>
  remaining arguments:  -J group -X format no suffix here

What else do you need?

Bye
 Sven


--
Sven Wischnowsky                         wischnow@informatik.hu-berlin.de


             reply	other threads:[~2000-05-23 14:00 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-05-23 13:58 Sven Wischnowsky [this message]
  -- strict thread matches above, loose matches on Subject: below --
2000-05-24  8:05 Sven Wischnowsky
2000-05-23 13:15 Sven Wischnowsky
2000-05-23 13:50 ` Oliver Kiddle
2000-05-22  8:37 Sven Wischnowsky
2000-05-23 16:07 ` Oliver Kiddle
2000-05-18 11:02 Sven Wischnowsky
2000-05-19 18:39 ` Oliver Kiddle

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200005231358.PAA25220@beta.informatik.hu-berlin.de \
    --to=wischnow@informatik.hu-berlin.de \
    --cc=zsh-workers@sunsite.auc.dk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).