| 152 | } |
| 153 | |
| 154 | static command_result hotkeys_cmd(color_ostream &out, vector <string> & parameters) { |
| 155 | if (!parameters.size()) { |
| 156 | DEBUG(log).print("invoking command: '{}'\n", INVOKE_MENU_DEFAULT_COMMAND); |
| 157 | return Core::getInstance().runCommand(out, INVOKE_MENU_DEFAULT_COMMAND); |
| 158 | } else if (parameters.size() == 2 && parameters[0] == "menu") { |
| 159 | string cmd = INVOKE_MENU_BASE_COMMAND + parameters[1]; |
| 160 | DEBUG(log).print("invoking command: '{}'\n", cmd); |
| 161 | return Core::getInstance().runCommand(out, cmd); |
| 162 | } |
| 163 | |
| 164 | if (parameters[0] == "list") { |
| 165 | list(out); |
| 166 | return CR_OK; |
| 167 | } |
| 168 | |
| 169 | // internal command -- intentionally undocumented |
| 170 | if (parameters.size() != 2 || parameters[0] != "invoke") |
| 171 | return CR_WRONG_USAGE; |
| 172 | |
| 173 | int index = string_to_int(parameters[1], -1); |
| 174 | if (index < 0) |
| 175 | return CR_WRONG_USAGE; |
| 176 | return invoke_command(out, index) ? CR_OK : CR_WRONG_USAGE; |
| 177 | } |
| 178 | |
| 179 | DFhackCExport command_result plugin_init (color_ostream &out, std::vector <PluginCommand> &commands) { |
| 180 | commands.push_back( |
nothing calls this directly
no test coverage detected