Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
How to sort _arguments?
- X-seq: zsh-users 24318
- From: "chiasa.men" <chiasa.men@xxxxxx>
- To: zsh-users@xxxxxxx
- Subject: How to sort _arguments?
- Date: Mon, 30 Sep 2019 21:02:24 +0200
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/simple; d=web.de; s=dbaedf251592; t=1569870146; bh=+/rehvJjsllmlzFgj7DQZ2aGSOOSijpQ6pvL0zhyJNY=; h=X-UI-Sender-Class:From:To:Subject:Date; b=s7SUPtcIfd+ltqeNr9me136YNkLAU/KRApQV6ISUnm91QjqHkbsaFTDiN7TSh3ry9 0+mmBuK3Qe8dePQ8Rf0D19kVxDV1Lq9tZ2KbEpv8K6WxDth6LsRxsa0zTrT8zMZ82U yhfH9OWdNg+Lr8UIRlSd+rcC8uMy4yikxfL2KusA=
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- List-unsubscribe: <mailto:zsh-users-unsubscribe@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
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