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

Function PrintExamples

src/openrct2/command_line/CommandLine.cpp:232–256  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

230 }
231
232 static void PrintExamples(const CommandLineExample* examples)
233 {
234 size_t maxArgumentsLength = 0;
235
236 const CommandLineExample* example;
237 for (example = examples; example->Arguments != nullptr; example++)
238 {
239 size_t argumentsLength = String::lengthOf(example->Arguments);
240 maxArgumentsLength = std::max(maxArgumentsLength, argumentsLength);
241 }
242
243 Console::WriteLine("examples:");
244 for (example = examples; example->Arguments != nullptr; example++)
245 {
246 Console::Write(" openrct2 ");
247 Console::Write(example->Arguments);
248
249 size_t argumentsLength = String::lengthOf(example->Arguments);
250 Console::WriteSpace(maxArgumentsLength - argumentsLength + 4);
251 Console::Write(example->Description);
252 Console::WriteLine();
253 }
254
255 Console::WriteLine();
256 }
257
258 static utf8* GetOptionCaption(utf8* buffer, size_t bufferSize, const CommandLineOptionDefinition* option)
259 {

Callers 1

PrintHelpFunction · 0.85

Calls 4

lengthOfFunction · 0.85
WriteLineFunction · 0.85
WriteFunction · 0.85
WriteSpaceFunction · 0.85

Tested by

no test coverage detected