From: Bart Schaefer <schaefer@brasslantern.com>
To: Philippe Proulx <eeppeliteloop@gmail.com>
Cc: Daniel Shahaf <d.s@daniel.shahaf.name>, Zsh Users <zsh-users@zsh.org>
Subject: Re: How to complete with _arguments() depending on an option and within a loop
Date: Wed, 12 May 2021 08:50:10 -0700 [thread overview]
Message-ID: <CAH+w=7aWXbvnGdjfHYqvKovRUv8ZkZFSQ+4E6uQrjZ=q1Na6+g@mail.gmail.com> (raw)
In-Reply-To: <CAB4xu_17dJDXUVHtksHTJ=xGEsrW=7K-t5jvGOd_n=_kYG55mw@mail.gmail.com>
On Wed, May 12, 2021 at 8:15 AM Philippe Proulx <eeppeliteloop@gmail.com> wrote:
>
> I believe the complexity of Zsh completion can translate into better
> command line UX.
Certainly.
> Why would _argument() support not repeating an option (the default)
> then (`--opt[my option]` vs `*--opt[my option]`)?
It's a degrees-of-effort thing.
There's a (subjective) point at which the effort to limit the
completion results to exactly what "makes sense" in a given context,
exceeds the benefit of doing so. I think that a lot of the time the
benefit is given so much weight that the effort becomes unreasonable.
Completion shouldn't offer nonsense (like the \"\"\" result in another
recent thread, that's clearly a bug) but it's rarely going to achieve
perfection.
Returning to your specific question, you might look at using
_regex_arguments instead. If you can figure out the syntax, you can
put almost unlimited effort into making the result perfect.
next prev parent reply other threads:[~2021-05-12 15:51 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-05-10 17:30 Philippe Proulx
2021-05-11 14:12 ` Daniel Shahaf
2021-05-12 13:44 ` Philippe Proulx
2021-05-12 15:11 ` Bart Schaefer
2021-05-12 15:14 ` Philippe Proulx
2021-05-12 15:50 ` Bart Schaefer [this message]
2021-05-12 16:14 ` Ray Andrews
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='CAH+w=7aWXbvnGdjfHYqvKovRUv8ZkZFSQ+4E6uQrjZ=q1Na6+g@mail.gmail.com' \
--to=schaefer@brasslantern.com \
--cc=d.s@daniel.shahaf.name \
--cc=eeppeliteloop@gmail.com \
--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).