Subject: Re: Zstyle command completion does not work for some executables
From: Bart Schaefer <[email-masked]>
To: [email-masked]
Date: Fri, 29 Jan 2016 09:52:39 -0800
List-Id: Zsh Workers List <zsh-workers.zsh.org>

[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.]