code cleanup for kubectl alpha -h

This commit is contained in:
xiongzhongliang 2020-12-27 07:30:44 +08:00
parent 0a839c6c3b
commit 5eff181ec3

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"))
})