Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: How to get all tagets for rake completion?

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

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.


Messages sorted by: Reverse Date, Date, Thread, Author