Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: How to get all tagets for rake completion?
- X-seq: zsh-users 26617
- From: Oliver Kiddle <opk@xxxxxxx>
- To: Jörg Sommer <joerg@xxxxxxxx>
- Cc: zsh-users@xxxxxxx
- Subject: Re: How to get all tagets for rake completion?
- Date: Wed, 31 Mar 2021 02:10:14 +0200
- Archived-at: <https://zsh.org/users/26617>
- Archived-at: <http://www.zsh.org/sympa/arcsearch_id/zsh-users/2021-03/43486-1617149414.412147%40zBmo.ESTa.9XAh>
- In-reply-to: <20201215214027.a3htwtas6su3fhz5@jo-so.de>
- List-id: <zsh-users.zsh.org>
- References: <20201215125724.b6qdvvuhr2mwpxbz@jo-so.de> <1047872238.2253883.1608052325319@mail2.virginmedia.com> <20201215214027.a3htwtas6su3fhz5@jo-so.de>
On 15 Dec, Jörg Sommer wrote:
> > > I would like to get all targets for the completion of rake arguments. How
> > > can I inject an argument to the targets query call or how to replace it? I
> > > have to pass `-A` to *rake* to get the arguments for the completion.
Sorry that this patch didn't receive any attention earlier.
To try to understand this, what is the disadvantage of calling rake with
-A? Does that make it much slower or is it that most users wouldn't want
"uncommented" targets? If they're fully applicable, it may be better to
add the -A without a style. It looks like the descriptions are included
in the rake output so you could separate them out and add matches with
both the commented-targets and uncommented-targets tags.
Incidentally, _rake doesn't seem to complete the -A option so that must
be newish.
> What do you think about the attached commit? Is it fine or should I change
> anything?
When looking up the style, you should include the tag in the context
when one is applicable, so ":completion:${curcontext}:targets" in this
case.
As a general principle, it is better to use a style name that has a
generic meaning. I can't find any existing style along the lines of an
extra-matches, more-matches, allow-slow-generation etc so unless I've
missed one you'd need to invent a suitable one. "all-targets" is too
specific to targets.
Oliver
Messages sorted by:
Reverse Date,
Date,
Thread,
Author