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

How to sort _arguments?



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





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