ApplyRootCommand iterates through every CommandProvider registered in the container, and introduce the root *cobra.Command to everyone.
(command *cobra.Command)
| 423 | // ApplyRootCommand iterates through every CommandProvider registered in the container, |
| 424 | // and introduce the root *cobra.Command to everyone. |
| 425 | func (c *C) ApplyRootCommand(command *cobra.Command) { |
| 426 | modules := c.Modules() |
| 427 | for i := range modules { |
| 428 | if p, ok := modules[i].(CommandProvider); ok { |
| 429 | p.ProvideCommand(command) |
| 430 | } |
| 431 | } |
| 432 | } |
| 433 | |
| 434 | // Invoke runs the given function after instantiating its dependencies. Any |
| 435 | // arguments that the function has are treated as its dependencies. The |