From 3b00b9a5daa6f2fd2adb5d2c5f6815ecef830e91 Mon Sep 17 00:00:00 2001 From: Kazuki Suda Date: Fri, 7 Jul 2017 01:03:35 +0900 Subject: [PATCH] Fix a bug that --flag=val causes completion error in zsh Remove __kubectl_declare `declare -F` is already replaced to `whence -w` by __kubectl_convert_bash_to_zsh(). --- pkg/kubectl/cmd/completion.go | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/pkg/kubectl/cmd/completion.go b/pkg/kubectl/cmd/completion.go index 09f8f5cead4..94ad28395da 100644 --- a/pkg/kubectl/cmd/completion.go +++ b/pkg/kubectl/cmd/completion.go @@ -191,14 +191,6 @@ __kubectl_compopt() { true # don't do anything. Not supported by bashcompinit in zsh } -__kubectl_declare() { - if [ "$1" == "-F" ]; then - whence -w "$@" - else - builtin declare "$@" - fi -} - __kubectl_ltrim_colon_completions() { if [[ "$1" == *:* && "$COMP_WORDBREAKS" == *:* ]]; then @@ -286,7 +278,7 @@ __kubectl_convert_bash_to_zsh() { -e "s/${LWORD}__ltrim_colon_completions${RWORD}/__kubectl_ltrim_colon_completions/g" \ -e "s/${LWORD}compgen${RWORD}/__kubectl_compgen/g" \ -e "s/${LWORD}compopt${RWORD}/__kubectl_compopt/g" \ - -e "s/${LWORD}declare${RWORD}/__kubectl_declare/g" \ + -e "s/${LWORD}declare${RWORD}/builtin declare/g" \ -e "s/\\\$(type${RWORD}/\$(__kubectl_type/g" \ <<'BASH_COMPLETION_EOF' `