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

grouping/joining _values



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