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

Re: custom script Bash completion

On 11/10/13, 1:24 PM, Bart Schaefer wrote:

>> 'tu --get-bash-completion' is invoked by zsh completion, but the three
>> arguments bash would pass to it aren't being passed.
> I'm not absolutely sure if the following explains that, because none of
> the bash man pages I can find describe what those three arguments are,

In the Bash-4.2 info manual, you find:

"After these matches have been generated, any shell function or command
specified with the @option{-F} and @option{-C} options is invoked.
When the command or function is invoked, the @env{COMP_LINE},
@env{COMP_POINT}, @env{COMP_KEY}, and @env{COMP_TYPE} variables are
assigned values as described above (@pxref{Bash Variables}).
If a shell function is being invoked, the @env{COMP_WORDS} and
@env{COMP_CWORD} variables are also set.
When the function or command is invoked, the first argument is the
name of the command whose arguments are being completed, the
second argument is the word being completed, and the third argument
is the word preceding the word being completed on the current command

``The lyf so short, the craft so long to lerne.'' - Chaucer
		 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, ITS, CWRU    chet@xxxxxxxx    http://cnswww.cns.cwru.edu/~chet/

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