MCPcopy Create free account
hub / github.com/JibbSmart/JoyShockMapper / RunHelp

Method RunHelp

JoyShockMapper/src/main.cpp:2701–2728  ·  view source on GitHub ↗

The run function is nothing like the delegate. See how I use the bind function below to hard-code the pointer parameter and the instance pointer 'this'.

Source from the content-addressed store, hash-verified

2699 // The run function is nothing like the delegate. See how I use the bind function
2700 // below to hard-code the pointer parameter and the instance pointer 'this'.
2701 void RunHelp(CmdRegistry *registry)
2702 {
2703 if (arg.empty())
2704 {
2705 // Show all commands
2706 cout << "Here's the list of all commands." << endl;
2707 vector<string> list;
2708 registry->GetCommandList(list);
2709 for (auto cmd : list)
2710 {
2711 cout << " " << cmd << endl;
2712 }
2713 cout << "Enter HELP [cmd1] [cmd2] ... for details on specific commands." << endl;
2714 }
2715 else
2716 {
2717 auto help = registry->GetHelp(arg);
2718 if (!help.empty())
2719 {
2720 cout << arg << " :" << endl <<
2721 " " << help << endl;
2722 }
2723 else
2724 {
2725 cout << arg << " is not a recognized command" << endl;
2726 }
2727 }
2728 }
2729public:
2730 HelpCmd(CmdRegistry &reg)
2731 : JSMMacro("HELP")

Callers

nothing calls this directly

Calls 2

GetCommandListMethod · 0.80
GetHelpMethod · 0.80

Tested by

no test coverage detected