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

Re: Zstyle command completion does not work for some executables



[I wrote all this and then it never went out.  Sending it anyway because
it adds a little bit to PWS's response.]

On Jan 28, 12:52pm, Silvio Ricardo Cordeiro wrote:
} Subject: Zstyle command completion does not work for some executables

The "command" style is implemented by the _call_program helper function.
Consequently it only works for completions that use _call_program.

Doc says:

     In many places, completion functions need to call external
     commands to generate the list of completions.  This style can be
     used to override the command that is called in some such cases.

In your examples e.g.

} > zstyle ':completion:*:*bash*:*' command 'echo testing'

The writer of the _sh completion did not feel any external command
was needed in order to generate the list of completions, so no use
of _call_program was made and the command style does not apply.  For
an arbitrary command in your path, there probably isn't a specific
completion function at all, so there can't be a _call_program.

[Rest trimmed as it duplicated what PWS already said.]



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