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

Re: _arguments: normal arg spec with empty action



On 2016/10/21, at 15:31, Oliver Kiddle <okiddle@xxxxxxxxxxx> wrote:
> 
> I can't reproduce this so perhaps there's something setup related.
> Does pressing tab a third time work?

For me it happens even with 'zsh -f':

$ zsh -f
% autoload -Uz compinit
% compinit
% awk -<TAB>

The first <TAB> lists the options, but hitting <TAB> again (or
again and again ...) does not complete options.

>> The following patch fixes the problem, but is this the best way to go?
>> +    '1: : _message "program text"' \
> 
> Does _guard work? For a heading without matches, _message -e should be
> used but that roughly what _arguments is doing.

Thanks, the following seems to work:

	'1: : _guard "^-*" "program text"'

and I think this is better, because with the style

% zstyle ':completion:*:descriptions' format '%d'

and if _message is used, then

% awk -<TAB>

will print both "program text" and "options", but only
"options" is printed if _guard is used.


Jun



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