zsh-users
 help / color / Atom feed
* How to sort _arguments?
@ 2019-09-30 19:02 chiasa.men
  0 siblings, 0 replies; only message in thread
From: chiasa.men @ 2019-09-30 19:02 UTC (permalink / raw)
  To: zsh-users

My application has arguments which are grouped semantically

e.g.
./app --argB --argII --arg2 --argA --argI --arg1
where the groups would be:
1: argA, argI and arg1
2: argB, argII and arg2

Is it possible to group the _arguments array in the same manner?

like:<tab>
completing group 1
--argA
--argI
--arg1

completing group 2
--argB
--argII
--arg2

The default setting seems to be
completing
--arg1
--arg2
--argA
--argB
--argI
--argII

alphabetically sorted without grouping


I understand that the "group" concept in zsh completion is more like a
exclusion component?!

Some expiriments lead to the idea of

zstyle ':completion:*' tag-order \
    'options:-group1:group1 options
     options:-group2:group2 options'
zstyle ':completion:*:options-group1' \
     ignored-patterns '--arg(2|II|B)'
zstyle ':completion:*:options-group2' \
     ignored-patterns '--arg(1|I|A)'

But that seems to be a rather odd way of accomplishing this..




^ permalink raw reply	[flat|nested] only message in thread

only message in thread, back to index

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-30 19:02 How to sort _arguments? chiasa.men

zsh-users

Archives are clonable: git clone --mirror http://inbox.vuxu.org/zsh-users

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://inbox.vuxu.org/vuxu.archive.zsh.users


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git