Skip to content

Commit 1f9d257

Browse files
authored
Merge pull request kubernetes#127869 from ak20102763/explain_o_shorthand
Added shorthand for kubectl explain --output
2 parents fe21843 + 923a413 commit 1f9d257

File tree

1 file changed

+2
-2
lines changed
  • staging/src/k8s.io/kubectl/pkg/cmd/explain

1 file changed

+2
-2
lines changed

staging/src/k8s.io/kubectl/pkg/cmd/explain/explain.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ func NewCmdExplain(parent string, f cmdutil.Factory, streams genericiooptions.IO
9696
o := NewExplainOptions(parent, streams)
9797

9898
cmd := &cobra.Command{
99-
Use: "explain TYPE [--recursive=FALSE|TRUE] [--api-version=api-version-group] [--output=plaintext|plaintext-openapiv2]",
99+
Use: "explain TYPE [--recursive=FALSE|TRUE] [--api-version=api-version-group] [-o|--output=plaintext|plaintext-openapiv2]",
100100
DisableFlagsInUseLine: true,
101101
Short: i18n.T("Get documentation for a resource"),
102102
Long: explainLong + "\n\n" + cmdutil.SuggestAPIResources(parent),
@@ -111,7 +111,7 @@ func NewCmdExplain(parent string, f cmdutil.Factory, streams genericiooptions.IO
111111
cmd.Flags().StringVar(&o.APIVersion, "api-version", o.APIVersion, "Use given api-version (group/version) of the resource.")
112112

113113
// Only enable --output as a valid flag if the feature is enabled
114-
cmd.Flags().StringVar(&o.OutputFormat, "output", plaintextTemplateName, "Format in which to render the schema. Valid values are: (plaintext, plaintext-openapiv2).")
114+
cmd.Flags().StringVarP(&o.OutputFormat, "output", "o", plaintextTemplateName, "Format in which to render the schema. Valid values are: (plaintext, plaintext-openapiv2).")
115115

116116
return cmd
117117
}

0 commit comments

Comments
 (0)