| 34 | } |
| 35 | |
| 36 | static command_result do_command(color_ostream &out, vector<string> ¶meters) { |
| 37 | if (!Core::getInstance().isMapLoaded()) { |
| 38 | out.printerr("Cannot run {} without a loaded map.\n", plugin_name); |
| 39 | return CR_FAILURE; |
| 40 | } |
| 41 | |
| 42 | bool show_help = false; |
| 43 | if (!Lua::CallLuaModuleFunction(out, "plugins.aquifer", "parse_commandline", std::make_tuple(parameters), |
| 44 | 1, [&](lua_State *L) { |
| 45 | show_help = !lua_toboolean(L, 1); |
| 46 | })) { |
| 47 | return CR_FAILURE; |
| 48 | } |
| 49 | |
| 50 | return show_help ? CR_WRONG_USAGE : CR_OK; |
| 51 | } |
| 52 | |
| 53 | //////////////////////////////////// |
| 54 | // Lua API |
nothing calls this directly
no test coverage detected