(cmd *cobra.Command)
| 110 | } |
| 111 | |
| 112 | func getCommands(cmd *cobra.Command) []Command { |
| 113 | var commands []Command |
| 114 | for _, c := range cmd.Commands() { |
| 115 | if c.Hidden || c.Name() == "help" { |
| 116 | continue |
| 117 | } |
| 118 | command := newCommand(c) |
| 119 | if c.HasAvailableSubCommands() { |
| 120 | command.SubCommands = getCommands(c) |
| 121 | } |
| 122 | commands = append(commands, command) |
| 123 | } |
| 124 | |
| 125 | return commands |
| 126 | } |
| 127 | |
| 128 | func describeCommand(cmd *cobra.Command) Command { |
| 129 | command := newCommand(cmd) |