mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-04 09:49:50 +00:00
Merge pull request #127869 from ak20102763/explain_o_shorthand
Added shorthand for kubectl explain --output
This commit is contained in:
commit
1f9d2577da
@ -96,7 +96,7 @@ func NewCmdExplain(parent string, f cmdutil.Factory, streams genericiooptions.IO
|
|||||||
o := NewExplainOptions(parent, streams)
|
o := NewExplainOptions(parent, streams)
|
||||||
|
|
||||||
cmd := &cobra.Command{
|
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,
|
DisableFlagsInUseLine: true,
|
||||||
Short: i18n.T("Get documentation for a resource"),
|
Short: i18n.T("Get documentation for a resource"),
|
||||||
Long: explainLong + "\n\n" + cmdutil.SuggestAPIResources(parent),
|
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.")
|
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
|
// 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
|
return cmd
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user