From: "chiasa.men" <chiasa.men@web.de>
To: zsh-users@zsh.org
Subject: How to sort _arguments?
Date: Mon, 30 Sep 2019 21:02:24 +0200 [thread overview]
Message-ID: <8441230.lnD9rH0TaQ@march> (raw)
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..
reply other threads:[~2019-09-30 19:03 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=8441230.lnD9rH0TaQ@march \
--to=chiasa.men@web.de \
--cc=zsh-users@zsh.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).