zsh-users
 help / color / mirror / code / 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, other threads:[~2019-09-30 19:03 UTC | newest]

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

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