mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-13 21:25:09 +00:00
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().
This commit is contained in:
@@ -191,14 +191,6 @@ __kubectl_compopt() {
|
|||||||
true # don't do anything. Not supported by bashcompinit in zsh
|
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()
|
__kubectl_ltrim_colon_completions()
|
||||||
{
|
{
|
||||||
if [[ "$1" == *:* && "$COMP_WORDBREAKS" == *:* ]]; then
|
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}__ltrim_colon_completions${RWORD}/__kubectl_ltrim_colon_completions/g" \
|
||||||
-e "s/${LWORD}compgen${RWORD}/__kubectl_compgen/g" \
|
-e "s/${LWORD}compgen${RWORD}/__kubectl_compgen/g" \
|
||||||
-e "s/${LWORD}compopt${RWORD}/__kubectl_compopt/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" \
|
-e "s/\\\$(type${RWORD}/\$(__kubectl_type/g" \
|
||||||
<<'BASH_COMPLETION_EOF'
|
<<'BASH_COMPLETION_EOF'
|
||||||
`
|
`
|
||||||
|
Reference in New Issue
Block a user