MCPcopy Create free account
hub / github.com/DFHack/dfhack / do_command

Function do_command

plugins/burrow.cpp:93–108  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

91}
92
93static command_result do_command(color_ostream &out, vector<string> &parameters) {
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

Callers

nothing calls this directly

Calls 2

CallLuaModuleFunctionFunction · 0.85
lua_tobooleanFunction · 0.85

Tested by

no test coverage detected