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

Re: How to get all tagets for rake completion?

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


> > 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?


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