AddCommand adds child commands and adds child commands for cobra as well.
(commands ...*Command)
| 42 | |
| 43 | // AddCommand adds child commands and adds child commands for cobra as well. |
| 44 | func (c *Command) AddCommand(commands ...*Command) { |
| 45 | c.childCommands = append(c.childCommands, commands...) |
| 46 | for _, cmd := range commands { |
| 47 | c.Command.AddCommand(cmd.Command) |
| 48 | } |
| 49 | } |
| 50 | |
| 51 | // ChildCommands returns the child commands. |
| 52 | func (c *Command) ChildCommands() []*Command { |
no outgoing calls
no test coverage detected