kubectl: add completion

This commit is contained in:
Daniel Santana 2018-05-27 00:39:58 -03:00 committed by Enno Boland
parent 17c3a114a1
commit b55f697bd0
2 changed files with 12 additions and 0 deletions

View file

@ -0,0 +1,4 @@
For bash completions, install the 'bash-completion' package.
For zsh completions, put the following code in your ~/.zshrc:
source /usr/share/kubectl/completion.zsh

View file

@ -21,6 +21,12 @@ conf_files="/etc/kubernetes/*"
do_build() {
make
hack/generate-docs.sh
find "_output/local/bin/linux/" -type f -executable | grep "kubectl" | egrep -v "gen|test" | while read line
do
$line completion bash > completion.bash
$line completion zsh > completion.zsh
break
done
}
do_install() {
@ -50,6 +56,8 @@ kubectl_package() {
pkg_install() {
vmove usr/bin/kubectl
vmove usr/share/man/man1/kubectl*
vinstall completion.bash 644 usr/share/bash-completion/completions kubectl
vinstall completion.zsh 644 usr/share/kubectl
vlicense LICENSE
}
}