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 26619
- 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 11:50:28 +0200
- Archived-at: <https://zsh.org/users/26619>
- Archived-at: <http://www.zsh.org/sympa/arcsearch_id/zsh-users/2021-03/53310-1617184228.244862%40cFeP.EmJg.7ARq>
- In-reply-to: <20210331074548.b47tt6d2ekjrwdrs@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> <43486-1617149414.412147@zBmo.ESTa.9XAh> <20210331074548.b47tt6d2ekjrwdrs@jo-so.de>
Jörg Sommer wrote:
> It gives a much huger list and might contain many entries someone will never
> use. But I don't know what's common. From my point of view I prefer more
> than less.
It's certainly arguable that completion matches should be comprehensive.
But having fewer can be more useful. Perhaps consider including them by
default and having a style to filter them.
> Ah, okay. I must admit, I've never used zsytle queries before. I would make
> this change, right?
>
> - zstyle -t ":completion:${curcontext}" all-targets && all=-A
> + zstyle -t ":completion:${curcontext}:targets" all-targets && all=-A
Exactly.
> > 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.
>
> How about ‘verbose’?
The existing `verbose` style is usually used to conditionally add
descriptions to matches, especially where generating those descriptions
is slow or where they're of questionable value.
One existing style that adds additional matches is `use-ip` to add
IP addresses with hostnames. I don't really like "use" here but
`use-uncommented` would fit with that.
There are a few that do the converse – disable matches. `ignore-line`,
`ignore-parents`, `ignore-patterns`. An `ignore-uncommented` or
`ignore-undescribed` would fit in with those. But the sense is the
converse which may need different lookup code and perhaps implies the
opposite default. That could even be implemented from _describe itself.
Is rake -A giving you a fallback, e.g. "unknown" description for the
extra targets or does the description remain blank?
Oliver
Messages sorted by:
Reverse Date,
Date,
Thread,
Author