zsh-users
 help / color / mirror / code / Atom feed
From: Oliver Kiddle <okiddle@yahoo.co.uk>
To: "Scott Frazer" <frazer.scott@gmail.com>, zsh-users@zsh.org
Subject: Re: Complete value from list with colons
Date: Sun, 25 Aug 2019 03:18:17 +0200	[thread overview]
Message-ID: <43968-1566695897.640296@MmkN.TxK5.ExqF> (raw)
In-Reply-To: <8e5ab665-a4fb-4c75-a4a4-0a0734148b71@www.fastmail.com>

"Daniel Shahaf" wrote:
> Scott Frazer wrote on Sat, 24 Aug 2019 12:44 +00:00:
> > I would like to do completion from a list of values that have ':' in 
> > them, something like:
> > 
> > _values foo a::b c::d

> Backslashes:
>
> % _f() { _values desc 'foo\:\:FOO' 'bar\:\:BAR' } 

Or don't use _values:

  _wanted foos expl foo compadd a::b c::d

Which particular feature of _values do you want? For lists, you can use
_sequence, e.g.:
  _wanted foos expl foo _sequence compadd - a::b c::d

and if you want descriptions, _describe might do the job but probably
still needs colons to be quoted. _values is usually not the best choice
when the list of matches are generated somehow.

Oliver

  reply	other threads:[~2019-08-25  1:19 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-24 12:43 Scott Frazer
2019-08-24 17:26 ` Daniel Shahaf
2019-08-25  1:18   ` Oliver Kiddle [this message]
2019-08-26 13:34     ` Scott Frazer
2019-08-26 17:39       ` dana
2019-08-26 13:28   ` Scott Frazer

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=43968-1566695897.640296@MmkN.TxK5.ExqF \
    --to=okiddle@yahoo.co.uk \
    --cc=frazer.scott@gmail.com \
    --cc=zsh-users@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).