MCPcopy
hub / github.com/kubernetes/kubectl / NewCmdAlpha

Function NewCmdAlpha

pkg/cmd/alpha.go:30–46  ·  view source on GitHub ↗

NewCmdAlpha creates a command that acts as an alternate root command for features in alpha

(f cmdutil.Factory, streams genericiooptions.IOStreams)

Source from the content-addressed store, hash-verified

28
29// NewCmdAlpha creates a command that acts as an alternate root command for features in alpha
30func NewCmdAlpha(f cmdutil.Factory, streams genericiooptions.IOStreams) *cobra.Command {
31 cmd := &cobra.Command{
32 Use: "alpha",
33 Short: i18n.T("Commands for features in alpha"),
34 Long: templates.LongDesc(i18n.T("These commands correspond to alpha features that are not enabled in Kubernetes clusters by default.")),
35 }
36
37 // NewKubeletCommand() will hide the alpha command if it has no subcommands. Overriding
38 // the help function ensures a reasonable message if someone types the hidden command anyway.
39 if !cmd.HasAvailableSubCommands() {
40 cmd.SetHelpFunc(func(*cobra.Command, []string) {
41 cmd.Println(i18n.T("No alpha commands are available in this version of kubectl"))
42 })
43 }
44
45 return cmd
46}

Callers 1

NewKubectlCommandFunction · 0.85

Calls 2

TFunction · 0.92
LongDescFunction · 0.92

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…