Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
grouping/joining _values
- X-seq: zsh-users 12898
- From: Tomasz Pala <gotar@xxxxxxxxxx>
- To: zsh-users@xxxxxxxxxx
- Subject: grouping/joining _values
- Date: Sat, 7 Jun 2008 21:39:37 +0200
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
Hi,
I'm writing a completion and have stucked. I'd like to achieve sth like
this:
$ cmd -e [tab]
first group description
X -- X description
Y -- Y description
Z -- Z description
second group description
a b c d e
f g h i j
k l m n o
third group description
abc def
but there's a catch - all of these could follow each other in
coma separated list, so the result may be:
$ c,d -e X,d,def,Z,l,j
in order to have coma separators I use:
_group1 () {
_values -s , "first group description" element1 element2
}
but if I define 3 of them and join as follows:
_alternative 'group1::_group1' 'group2::_group2' 'group3::_group3'
the result is flawed. First of all descriptions appear on top:
first group description
second group description
third group description
X -- X description
Y -- Y description
Z -- Z description
a b c d e
f g h i j
k l m n o
abc def
second problem occours after selecting some elements - the choice is
limited to the group of the last one, e.g.
$ c,d -e X,abc,o[tab]
second group description
a b c d e
f g h i j
k l m n
So is there a way to join multiple _values (or something else that can
be coma separated) or make grouping within one list?
--
Tomasz Pala <gotar@xxxxxxxxxxxxx>
Messages sorted by:
Reverse Date,
Date,
Thread,
Author