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

Function get_options

plugins/dig-now.cpp:989–1011  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

987}
988
989static bool get_options(color_ostream &out,
990 dig_now_options &opts,
991 const std::vector<std::string> &parameters) {
992 auto L = DFHack::Core::getInstance().getLuaState();
993 Lua::StackUnwinder top(L);
994
995 if (!lua_checkstack(L, parameters.size() + 2) ||
996 !Lua::PushModulePublic(
997 out, L, "plugins.dig-now", "parse_commandline")) {
998 out.printerr("Failed to load dig-now Lua code\n");
999 return false;
1000 }
1001
1002 Lua::Push(L, &opts);
1003
1004 for (const std::string &param : parameters)
1005 Lua::Push(L, param);
1006
1007 if (!Lua::SafeCall(out, L, parameters.size() + 1, 0))
1008 return false;
1009
1010 return true;
1011}
1012
1013bool dig_now_impl(color_ostream &out, const dig_now_options &options) {
1014 if (!Maps::IsValid()) {

Callers 1

dig_nowFunction · 0.85

Calls 5

lua_checkstackFunction · 0.85
PushModulePublicFunction · 0.85
PushFunction · 0.85
SafeCallFunction · 0.85
sizeMethod · 0.45

Tested by

no test coverage detected