MCPcopy Create free account
hub / github.com/cloudwan/gohan / ExecuteCommand

Method ExecuteCommand

cli/client/client.go:138–152  ·  view source on GitHub ↗

ExecuteCommand ...

(command string, arguments []string)

Source from the content-addressed store, hash-verified

136
137// ExecuteCommand ...
138func (gohanClientCLI *GohanClientCLI) ExecuteCommand(command string, arguments []string) (string, error) {
139 actionName := getCustomCommandName(command, len(arguments))
140 for _, c := range gohanClientCLI.commands {
141 if c.Name == command {
142 if actionName != "" {
143 action := c.Schema.GetActionFromCommand(actionName)
144 if !action.TakesNoArgs() {
145 return outputCustomCommands(c.Schema, action)
146 }
147 }
148 return c.Action(arguments)
149 }
150 }
151 return gohanClientCLI.outputSubCommands(command)
152}
153
154//Output sub command helps
155func (gohanClientCLI *GohanClientCLI) outputSubCommands(command string) (string, error) {

Callers 2

getGohanClientCommandFunction · 0.95
client_test.goFile · 0.80

Calls 5

outputSubCommandsMethod · 0.95
getCustomCommandNameFunction · 0.85
outputCustomCommandsFunction · 0.85
GetActionFromCommandMethod · 0.80
TakesNoArgsMethod · 0.80

Tested by

no test coverage detected