Open mylesagray opened 5 years ago
cc @xstevens ?
I don't have any zsh experience and rely on others for this support
EDIT: that said, i can look into this at some point
cc @mdaverde
.... :D
@mylesagray Hey Myles, I was just setting up my new M1-based Mac and getting ktx
working under Zsh 5.8. I was able to make completion work this way.
I created a completion function (named _ktx
) and placed it into ~/.zsh/functions
(which is part of the FPATH
). The contents of this file:
#compdef ktx
KUBECONFIG_DIR=${KUBECONFIG_DIR:-"${HOME}/.kube/"}
_ktx() {
_arguments -s -S \
"*::filename:_files -W ${KUBECONFIG_DIR}"
}
I already had initialized the completion system in ~/.zshrc
with autoload -Uz compinit && compinit
. I still need to do some fine-tuning, but it does work.
Hope this helps!
That did the trick, thanks @scottslowe! - hope the new gig is working out for you too :)
Env: macOS 10.14 / zsh + oh-my-zsh shell
ktx
completion doesn't work because zsh doesn't have thecomplete
keyword like bash does.Is there any way you can add completion that supports zsh too?