From 4106fc8791c05ccffc330975350321e406f52f39 Mon Sep 17 00:00:00 2001 From: Akash <73993188+ak20102763@users.noreply.github.com> Date: Sat, 5 Oct 2024 03:19:57 +0530 Subject: [PATCH] Added shorthand for explain --output Removed short flag example Kubernetes-commit: 923a41370dc85062241fa149edda1307a16910e2 --- pkg/cmd/explain/explain.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/cmd/explain/explain.go b/pkg/cmd/explain/explain.go index 1cde9006..0932e031 100644 --- a/pkg/cmd/explain/explain.go +++ b/pkg/cmd/explain/explain.go @@ -96,7 +96,7 @@ func NewCmdExplain(parent string, f cmdutil.Factory, streams genericiooptions.IO o := NewExplainOptions(parent, streams) cmd := &cobra.Command{ - Use: "explain TYPE [--recursive=FALSE|TRUE] [--api-version=api-version-group] [--output=plaintext|plaintext-openapiv2]", + Use: "explain TYPE [--recursive=FALSE|TRUE] [--api-version=api-version-group] [-o|--output=plaintext|plaintext-openapiv2]", DisableFlagsInUseLine: true, Short: i18n.T("Get documentation for a resource"), Long: explainLong + "\n\n" + cmdutil.SuggestAPIResources(parent), @@ -111,7 +111,7 @@ func NewCmdExplain(parent string, f cmdutil.Factory, streams genericiooptions.IO cmd.Flags().StringVar(&o.APIVersion, "api-version", o.APIVersion, "Use given api-version (group/version) of the resource.") // Only enable --output as a valid flag if the feature is enabled - cmd.Flags().StringVar(&o.OutputFormat, "output", plaintextTemplateName, "Format in which to render the schema. Valid values are: (plaintext, plaintext-openapiv2).") + cmd.Flags().StringVarP(&o.OutputFormat, "output", "o", plaintextTemplateName, "Format in which to render the schema. Valid values are: (plaintext, plaintext-openapiv2).") return cmd }