| 91 | } |
| 92 | |
| 93 | static command_result do_command(color_ostream &out, vector<string> ¶meters) { |
| 94 | if (!Core::getInstance().isMapLoaded() || !World::isFortressMode()) { |
| 95 | out.printerr("Cannot run {} without a loaded fort.\n", plugin_name); |
| 96 | return CR_FAILURE; |
| 97 | } |
| 98 | |
| 99 | bool show_help = false; |
| 100 | if (!Lua::CallLuaModuleFunction(out, "plugins.burrow", "parse_commandline", parameters, |
| 101 | 1, [&](lua_State *L) { |
| 102 | show_help = !lua_toboolean(L, -1); |
| 103 | })) { |
| 104 | return CR_FAILURE; |
| 105 | } |
| 106 | |
| 107 | return show_help ? CR_WRONG_USAGE : CR_OK; |
| 108 | } |
| 109 | |
| 110 | ///////////////////////////////////////////////////// |
| 111 | // listener logic |
nothing calls this directly
no test coverage detected