mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-29 14:37:00 +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:
parent
e8eb858b2a
commit
3b00b9a5da
@ -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'
|
||||
`
|
||||
|
Loading…
Reference in New Issue
Block a user