MCPcopy Index your code
hub / github.com/abiosoft/ishell / AddCmd

Method AddCmd

command.go:43–48  ·  view source on GitHub ↗

AddCmd adds cmd as a subcommand.

(cmd *Cmd)

Source from the content-addressed store, hash-verified

41
42// AddCmd adds cmd as a subcommand.
43func (c *Cmd) AddCmd(cmd *Cmd) {
44 if c.children == nil {
45 c.children = make(map[string]*Cmd)
46 }
47 c.children[cmd.Name] = cmd
48}
49
50// DeleteCmd deletes cmd from subcommands.
51func (c *Cmd) DeleteCmd(name string) {

Callers 8

mainFunction · 0.95
addDefaultFuncsFunction · 0.45
TestAddCommandFunction · 0.45
TestDeleteCommandFunction · 0.45
TestFindCmdFunction · 0.45
TestFindAliasFunction · 0.45
TestHelpTextFunction · 0.45

Calls

no outgoing calls

Tested by 6

TestAddCommandFunction · 0.36
TestDeleteCommandFunction · 0.36
TestFindCmdFunction · 0.36
TestFindAliasFunction · 0.36
TestHelpTextFunction · 0.36