zsh-workers
 help / color / mirror / code / Atom feed
From: Danek Duvall <duvall@comfychair.org>
To: Oliver Kiddle <okiddle@yahoo.co.uk>
Cc: zsh-workers@zsh.org
Subject: Re: completing a comma-separated pair of values
Date: Sun, 6 Mar 2011 14:59:23 -0800	[thread overview]
Message-ID: <20110306225923.GD18627@lorien.comfychair.org> (raw)
In-Reply-To: <9974.1299450496@thecus>

Oliver Kiddle wrote:

> I may have misunderstood this but you can use the return status of
> compset -P directly so that you possibly don't need this. e.g:
> 	if compset -P '*,'; then

Indeed; thanks.  I've also added the optional number 1 to -P, which means
that it'll prevent you from trying to put a second comma on there and
continue completing.

> > The only problem is that (I think) this may need to be completed in a
> > longer series of comma-separated values:
> 
> You can also do a while loop if there's no particular ordering to things
> in the list: while compset -P '*,' Otherwise, use elif for each
> component.

There's an ordering to the arguments of keysource, but not to the list of
things that keysource is in.  So we could have

    foo=64,bar,keysource=passphrase,prompt,baz=true

or
    foo=64,keysource=passphrase,prompt,bar,baz=true

etc.  I want to complete the two comma-separated values after keysource=
with my function, but everything else in this list would be handled
naturally by _values, as if keysource took only a single argument.

Danek


      reply	other threads:[~2011-03-06 22:59 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-03 23:00 Danek Duvall
2011-03-03 23:27 ` Mikael Magnusson
2011-03-03 23:58   ` Danek Duvall
2011-03-05  1:00     ` Danek Duvall
2011-03-05  9:20       ` Štěpán Němec
2011-03-05 14:15         ` Danek Duvall
2011-03-06 22:28           ` Oliver Kiddle
2011-03-06 22:59             ` Danek Duvall [this message]

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=20110306225923.GD18627@lorien.comfychair.org \
    --to=duvall@comfychair.org \
    --cc=okiddle@yahoo.co.uk \
    --cc=zsh-workers@zsh.org \
    /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).