From: Bart Schaefer <firstname.lastname@example.org>
To: Philippe Proulx <email@example.com>
Cc: Daniel Shahaf <firstname.lastname@example.org>, Zsh Users <email@example.com>
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=q1Na6firstname.lastname@example.org> (raw)
On Wed, May 12, 2021 at 8:15 AM Philippe Proulx <email@example.com> wrote:
> I believe the complexity of Zsh completion can translate into better
> command line UX.
> 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
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
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:
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
* 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
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).