mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-29 06:27:05 +00:00
Filter unavailable commands in help
This commit is contained in:
parent
50bbe57811
commit
d82f452b85
@ -145,7 +145,7 @@ func (t *templater) cmdGroupsString(c *cobra.Command) string {
|
||||
for _, cmdGroup := range t.cmdGroups(c, c.Commands()) {
|
||||
cmds := []string{cmdGroup.Message}
|
||||
for _, cmd := range cmdGroup.Commands {
|
||||
if cmd.Runnable() {
|
||||
if cmd.IsAvailableCommand() {
|
||||
cmds = append(cmds, " "+rpad(cmd.Name(), cmd.NamePadding())+" "+cmd.Short)
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user