mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-14 13:45:06 +00:00
kubectl: fix hard-coded value in zsh completion
This commit is contained in:
@@ -17,6 +17,7 @@ limitations under the License.
|
|||||||
package completion
|
package completion
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"fmt"
|
||||||
"io"
|
"io"
|
||||||
|
|
||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
@@ -170,7 +171,8 @@ func runCompletionBash(out io.Writer, boilerPlate string, kubectl *cobra.Command
|
|||||||
}
|
}
|
||||||
|
|
||||||
func runCompletionZsh(out io.Writer, boilerPlate string, kubectl *cobra.Command) error {
|
func runCompletionZsh(out io.Writer, boilerPlate string, kubectl *cobra.Command) error {
|
||||||
zshHead := "#compdef kubectl\ncompdef _kubectl kubectl\n"
|
commandName := kubectl.Name()
|
||||||
|
zshHead := fmt.Sprintf("#compdef %[1]s\ncompdef _%[1]s %[1]s\n", commandName)
|
||||||
out.Write([]byte(zshHead))
|
out.Write([]byte(zshHead))
|
||||||
|
|
||||||
if len(boilerPlate) == 0 {
|
if len(boilerPlate) == 0 {
|
||||||
|
Reference in New Issue
Block a user