MCPcopy Index your code
hub / github.com/DoNewsCode/core / ApplyRootCommand

Method ApplyRootCommand

c.go:425–432  ·  view source on GitHub ↗

ApplyRootCommand iterates through every CommandProvider registered in the container, and introduce the root *cobra.Command to everyone.

(command *cobra.Command)

Source from the content-addressed store, hash-verified

423// ApplyRootCommand iterates through every CommandProvider registered in the container,
424// and introduce the root *cobra.Command to everyone.
425func (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

Callers 4

TestC_DefaultFunction · 0.80

Calls 2

ModulesMethod · 0.65
ProvideCommandMethod · 0.65

Tested by 4

TestC_DefaultFunction · 0.64