Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: More-verbose tab-completion idiom?
- X-seq: zsh-users 27574
- From: Phil Pennock <zsh-workers+phil.pennock@xxxxxxxxxxxx>
- To: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- Cc: Zsh Users <zsh-users@xxxxxxx>
- Subject: Re: More-verbose tab-completion idiom?
- Date: Wed, 16 Mar 2022 22:21:44 -0400
- Archived-at: <https://zsh.org/users/27574>
- In-reply-to: <CAH+w=7ahY_spSUq=PqgtD1Kv6j_qQeYC_eNcaucz1_r1KUZf=w@mail.gmail.com>
- List-id: <zsh-users.zsh.org>
- Openpgp: url=https://www.security.spodhuis.org/PGP/keys/keys-2013rsa-2020cv25519.asc
- References: <YjKATMd5ifSGX7eD@fullerene.field.pennock-tech.net> <CAH+w=7ahY_spSUq=PqgtD1Kv6j_qQeYC_eNcaucz1_r1KUZf=w@mail.gmail.com>
On 2022-03-16 at 18:20 -0700, Bart Schaefer wrote:
> but that assumes you don't have colons or commas or braces in the keys
> or descriptions.
Alas, one of the fields is almost guaranteed to be a URL, thus
containing a colon, and all of those are fair game in the description
field.
In case anyone is interested: while nats(1) (open-source, part of the
CNCF "NATS" project) is changing fast enough that we probably don't want
the completion shipping with zsh at this time, here's a copy of the
completion I'm using today:
https://get-nats.io/zsh.complete.nats
The tool is one of those Golang ones which has `--completion-bash` but
not `--completion-zsh` and where with a bit of custom zsh logic we can
do a "better than stock tool" job of generating a reasonably decent and
useful completion.
(I know that I'm misusing the per-flag description by listing it twice in
this way for the two different location but I haven't yet come up with
an easier-to-maintain approach)
-Phil
Messages sorted by:
Reverse Date,
Date,
Thread,
Author