From 634b83a7626b357bb329a6ccfe3e3d0b731bbd23 Mon Sep 17 00:00:00 2001 From: Nir Soffer Date: Sat, 22 Jun 2024 21:33:56 +0300 Subject: [PATCH] Fix kubectl-ns plugin help text The plugin help text was not consistent - using `ns` in some cases and `kubectl ns` in others. With this change we always have `kubectl ns`: $ kubectl ns -h View or set the current namespace Usage: kubectl ns [new-namespace] [flags] Examples: # view the current namespace in your KUBECONFIG kubectl ns # view all of the namespaces in use by contexts in your KUBECONFIG kubectl ns --list # switch your current-context to one that contains the desired namespace kubectl ns foo Flags: ... -h, --help help for kubectl ns --- staging/src/k8s.io/sample-cli-plugin/pkg/cmd/ns.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/staging/src/k8s.io/sample-cli-plugin/pkg/cmd/ns.go b/staging/src/k8s.io/sample-cli-plugin/pkg/cmd/ns.go index 1f93a05c9a9..af6c97aa2d9 100644 --- a/staging/src/k8s.io/sample-cli-plugin/pkg/cmd/ns.go +++ b/staging/src/k8s.io/sample-cli-plugin/pkg/cmd/ns.go @@ -82,6 +82,9 @@ func NewCmdNamespace(streams genericiooptions.IOStreams) *cobra.Command { Short: "View or set the current namespace", Example: fmt.Sprintf(namespaceExample, "kubectl"), SilenceUsage: true, + Annotations: map[string]string{ + cobra.CommandDisplayNameAnnotation: "kubectl ns", + }, RunE: func(c *cobra.Command, args []string) error { if err := o.Complete(c, args); err != nil { return err