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

Function getPluginCommand

library/LuaApi.cpp:4210–4228  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4208}
4209
4210static const PluginCommand * getPluginCommand(const char * command)
4211{
4212 auto plugins = Core::getInstance().getPluginManager();
4213 auto plugin = plugins->getPluginByCommand(command);
4214 if (!plugin)
4215 {
4216 return NULL;
4217 }
4218
4219 size_t num_commands = plugin->size();
4220 for (size_t i = 0; i < num_commands; ++i)
4221 {
4222 if ((*plugin)[i].name == command)
4223 return &(*plugin)[i];
4224 }
4225
4226 // not found (somehow)
4227 return NULL;
4228}
4229
4230static int internal_getCommandHelp(lua_State *L)
4231{

Callers 2

internal_getCommandHelpFunction · 0.85

Calls 2

getPluginByCommandMethod · 0.80
sizeMethod · 0.45

Tested by

no test coverage detected