I've used zsh compctl since forever (late 90s or early 00s) but strangly never run into this before.
I realized today when I intended to make some compctl config for update-alternatives
that my completions where not trigged at all, it just used my standard fallback completion (files) ...
so a very stripped down simple example to show the problem:
This works fine:
zshprompt% compctl -k '(arg1 arg2 arg3)' nodash
# typing 'nodash ' and hitting [Tab] once:
zshprompt% nodash arg
# hitting [Tab again]
zshprompt% nodash arg
arg1 arg2 arg3
But this complete files instead:
# just showing the current dir for reference:
zshprompt% ls .
file2.txt myfile1.txt
zshprompt% compctl -k '(arg1 arg2 arg3)' with-dash
# typing 'with-dash ' and hitting [Tab] once:
zshprompt% with-dash
file2.txt myfile1.txt
As seen, the standard completion (listing current directory) is used rather than the one I added with compctl ...
I couldn't really find anything about this in the manpage (man zshcompctl) or online ... so does somebody, please, have an idea on how to get compctl match commands with dashes in the name?
TIA