(cmd *cobra.Command)
| 280 | } |
| 281 | |
| 282 | func operationSubCommands(cmd *cobra.Command) []*cobra.Command { |
| 283 | cmds := []*cobra.Command{} |
| 284 | for _, sub := range cmd.Commands() { |
| 285 | if isPlugin(sub) { |
| 286 | continue |
| 287 | } |
| 288 | if _, ok := sub.Annotations["category-top"]; ok { |
| 289 | if cmd.Parent() == nil { |
| 290 | // for now, only use top-commands for the root-command |
| 291 | continue |
| 292 | } |
| 293 | } |
| 294 | if sub.IsAvailableCommand() && !sub.HasSubCommands() { |
| 295 | cmds = append(cmds, sub) |
| 296 | } |
| 297 | } |
| 298 | return cmds |
| 299 | } |
| 300 | |
| 301 | const defaultTermWidth = 80 |
| 302 |
no test coverage detected
searching dependent graphs…