Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Completing possible elements of a comma-separated list



-----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-----



Messages sorted by: Reverse Date, Date, Thread, Author