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

Re: zsh -<TAB> dose not use menu completion



On Feb 2, 10:56pm, Jun T. wrote:
} Subject: zsh -<TAB> dose not use menu completion
}
} if I type 'ls -<TAB><TAB>' then it goes into the menu completion. But
} for 'zsh -<TAB><TAB>' or 'zsh --a<TAB><TAB>' automenu does not work.

[...]

} If I replace
} 	_arguments -S -s -- '*:'	(line 27 of _sh)
} by
} 	_arguments -S -s --
} then 'zsh -^Xh' gives
}     options    (_arguments _sh)    # i.e., no argument-1
} and 'zsh -<TAB>' works as expected without the zstyle above.
} But I don't know why '*:' makes this difference.

Doc says (last sentence of this paragraph):

     In addition to options, `_arguments --' will try to deduce the
     types of arguments available for options when the form `--OPT=VAL'
     is valid.  It is also possible to provide hints by examining the
     help text of the command and adding HELPSPEC of the form
     `PATTERN:MESSAGE:ACTION'; note that other _arguments SPEC forms
     are not used.  The PATTERN is matched against the help text for an
     option, and if it matches the MESSAGE and ACTION are used as for
     other argument specifiers.  The special case of `*:' means both
     MESSAGE and ACTION are empty, which has the effect of causing
     options having no description in the help output to be ordered in
     listings ahead of options that have a description.

With "zstyle ':completion:*:zsh:*' tag-order options" all the --optname
options are listed *after* all the single-letter options.  So there is
something going on with the sort order that causes the menu not to be
entered when the --optname list comes first.



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