code cleanup for kubectl alpha -h

Kubernetes-commit: 5eff181ec30624706eb024467fb1b9d5c9a473f7
This commit is contained in:
xiongzhongliang 2020-12-27 07:30:44 +08:00 committed by Kubernetes Publisher
parent dcfa726ef4
commit bfad7fa736

View file

@ -40,7 +40,7 @@ func NewCmdAlpha(f cmdutil.Factory, streams genericclioptions.IOStreams) *cobra.
// NewKubeletCommand() will hide the alpha command if it has no subcommands. Overriding
// the help function ensures a reasonable message if someone types the hidden command anyway.
if !cmd.HasSubCommands() {
if !cmd.HasAvailableSubCommands() {
cmd.SetHelpFunc(func(*cobra.Command, []string) {
cmd.Println(i18n.T("No alpha commands are available in this version of kubectl"))
})