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

Re: Completion error message



Bart wrote:
> You only get the "no match for: ..." text if you have set the
> appropriate zstyle.

It also implies that a tag loop was run for particular tags even if
there were no matches.

> How about this?
>
> BartMAC2014% zstyle ':completion:*:messages' format %S%d%s
> BartMAC2014% rsync -4 -6 --
> no valid completions

If this is useful, then it might as well be done at the top-level in
_main_complete, perhaps controlled by a format style. Any function can
produce no matches and not even run through a tag loop–it isn't unique
to _arguments.

There's a variety of different conditions that cause comparguments -i to
return 1 besides all sets being disabled. For a very simple example,
take an arguments spec consisting of just options with no rest arguments,
e.g: _foo() { _arguments -a }, then try completion following a
non-option argument, e.g. foo arg <tab>
If _arguments is used in conjunction with another function (uncommon but
there are uses), the message would be unwanted. Only generating it from
_main_complete allows you to be sure there were no matches at all.

Oliver



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