MCPcopy Create free account
hub / github.com/OpenRCT2/OpenRCT2 / PrintHelp

Function PrintHelp

src/openrct2/command_line/CommandLine.cpp:118–149  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

116 static bool HandleSpecialArgument(const char* argument);
117
118 void PrintHelp(bool allCommands)
119 {
120 PrintHelpFor(kRootCommands);
121 PrintExamples(kRootExamples);
122
123 if (allCommands)
124 {
125 for (const CommandLineCommand* command = kRootCommands; command->Name != nullptr; command++)
126 {
127 if (command->SubCommands != nullptr)
128 {
129 size_t commandNameLength = String::lengthOf(command->Name);
130 for (size_t i = 0; i < commandNameLength; i++)
131 {
132 Console::Write("-");
133 }
134 Console::WriteLine();
135 Console::WriteLine(command->Name);
136 for (size_t i = 0; i < commandNameLength; i++)
137 {
138 Console::Write("-");
139 }
140 Console::WriteLine();
141 PrintHelpFor(command->SubCommands);
142 }
143 }
144 }
145 else
146 {
147 Console::WriteLine(kHelpText);
148 }
149 }
150
151 static void PrintHelpFor(const CommandLineCommand* commands)
152 {

Callers 1

HandleCommandDefaultMethod · 0.85

Calls 5

PrintHelpForFunction · 0.85
PrintExamplesFunction · 0.85
lengthOfFunction · 0.85
WriteFunction · 0.85
WriteLineFunction · 0.85

Tested by

no test coverage detected