ExecuteCommand ...
(command string, arguments []string)
| 136 | |
| 137 | // ExecuteCommand ... |
| 138 | func (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 |
| 155 | func (gohanClientCLI *GohanClientCLI) outputSubCommands(command string) (string, error) { |
no test coverage detected