MCPcopy Create free account
hub / github.com/OpenDungeons/OpenDungeons / helpCommand

Method helpCommand

source/modes/ConsoleInterface.cpp:241–266  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

239}
240
241Command::Result ConsoleInterface::helpCommand(const Command::ArgumentList_t& args, ConsoleInterface& console, AbstractModeManager&)
242{
243 if(args.size() > 1)
244 {
245 auto result = console.getCommandDescription(args[1]);
246 if(result)
247 {
248 console.print("Help for command \"" + args[1] + "\":\n");
249 console.print(*result + "\n");
250 }
251 else
252 {
253 console.print("Help for command \"" + args[1] + "\" not found!\n");
254 }
255 }
256 else
257 {
258 console.print("Commands:\n");
259 for(auto& it : console.mCommandMap)
260 {
261 console.print(it.first);
262 }
263 console.print("\n");
264 }
265 return Command::Result::SUCCESS;
266}

Callers

nothing calls this directly

Calls 2

getCommandDescriptionMethod · 0.80
printMethod · 0.45

Tested by

no test coverage detected