Zsh completions: use #compdef <program>

This means zsh scripts can't be sourced, but they can be automatically
loaded from files which is the standard way of doing it.
This commit is contained in:
Paul Ouellette
2019-07-24 11:06:58 -04:00
parent 5f0cf3721e
commit 9055452e41
2 changed files with 5 additions and 3 deletions

View File

@@ -86,7 +86,7 @@ complete -F _comptest -o bashdefault -o default comptest
it("generates correct zsh completion script", function()
assert.equal([=[
compdef _comptest comptest
#compdef comptest
_comptest() {
local context state state_descr line
@@ -179,6 +179,8 @@ _comptest_admin_cmds() {
)
_describe "command" commands
}
_comptest
]=], get_output("completion zsh"))
end)