I can't seem to figure out a way to call a zsh completion function that I can tap into and provide a return result of available items. For example, I'd like to be able to call out to a web service and return back an array of potentials.
I've tried something like this:
#compdef test
local arguments
_run(){
reply=(1 2 3)
}
arguments=(
'--test[foo]:bar:_run'
)
_arguments -s $arguments
If I put an echo in the _run
function I can see it getting executed, but zsh always says there are no matches