zsh-users
 help / color / mirror / code / Atom feed
From: Malte Starostik <malte.starostik@t-online.de>
To: zsh-users@sunsite.dk
Subject: Completing possible elements of a comma-separated list
Date: Thu, 18 Sep 2003 19:07:58 +0200	[thread overview]
Message-ID: <200309181908.01862.malte.starostik@t-online.de> (raw)

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi,

I'm trying to write a completion for slptool. One of its commands is
    slptool findattrs <service> [attr ids]
where service is an SLP service name or URL and attr ids is a comma-separated
list of attribute ids.
The following works fine for a single id, inserting a comma after it:

compadd -M 'm:{a-zA-Z}={A-Za-z}' -S, -q $(slptool findattrs $words[2] | \
    perl -pi -e 's#\(([^()]+)=[^()]*\),?#$1\n#g')

Now I'd like to continue completion with the same list of possible matches,
completing any id in the comma separated list independently of each other
against the list of available ids.

Example: (possible attribute ids: username password foo bar)
command typed so far:
    slptool findattrs example.acme u<TAB>
completes to (already works with the above):
    slptool findattrs example.acme username,
continuing:
    slptool findattrs example.acme username,p<TAB>
should complete to (this is what I'd like to achieve):
    slptool findattrs example.acme username,password,

Also, would be nice if
    slptool findattrs example.acme u,p<TAB>
could complete to
    slptool findattrs example.acme username,password,
as well.

Many thanks in advance,
- -Malte
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3 (GNU/Linux)

iD8DBQE/aeZwVDF3RdLzx4cRAq/FAJ9D61VZhfqIxBVlvQeOwLPBBrfLfwCeK3PD
cNMbKjTLWbsO83sMiO8/tZI=
=qeuC
-----END PGP SIGNATURE-----


             reply	other threads:[~2003-09-18 17:08 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-09-18 17:07 Malte Starostik [this message]
2003-09-19 13:03 ` Oliver Kiddle
2003-09-19 16:31   ` Malte Starostik
2003-09-20 16:35     ` Oliver Kiddle
2003-09-21  3:38     ` Hello Zsh users jayjwa

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=200309181908.01862.malte.starostik@t-online.de \
    --to=malte.starostik@t-online.de \
    --cc=zsh-users@sunsite.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).