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

Function internal_getCommandHelp

library/LuaApi.cpp:4230–4246  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4228}
4229
4230static int internal_getCommandHelp(lua_State *L)
4231{
4232 const PluginCommand *pc = getPluginCommand(luaL_checkstring(L, 1));
4233 if (!pc)
4234 {
4235 lua_pushnil(L);
4236 return 1;
4237 }
4238
4239 string help = pc->description;
4240 if (help.size() && help[help.size()-1] != '.')
4241 help += ".";
4242 if (pc->usage.size())
4243 help += "\n" + pc->usage;
4244 lua_pushstring(L, help.c_str());
4245 return 1;
4246}
4247
4248static int internal_getCommandDescription(lua_State *L)
4249{

Callers

nothing calls this directly

Calls 5

getPluginCommandFunction · 0.85
lua_pushnilFunction · 0.85
lua_pushstringFunction · 0.85
c_strMethod · 0.80
sizeMethod · 0.45

Tested by

no test coverage detected