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

Function GetOptionCaption

src/openrct2/command_line/CommandLine.cpp:258–284  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

256 }
257
258 static utf8* GetOptionCaption(utf8* buffer, size_t bufferSize, const CommandLineOptionDefinition* option)
259 {
260 buffer[0] = 0;
261
262 if (option->ShortName != '\0')
263 {
264 String::appendFormat(buffer, bufferSize, "-%c, ", option->ShortName);
265 }
266
267 String::append(buffer, bufferSize, "--");
268 String::append(buffer, bufferSize, option->LongName);
269
270 switch (option->Type)
271 {
272 case CMDLINE_TYPE_INTEGER:
273 String::append(buffer, bufferSize, "=<int>");
274 break;
275 case CMDLINE_TYPE_REAL:
276 String::append(buffer, bufferSize, "=<real>");
277 break;
278 case CMDLINE_TYPE_STRING:
279 String::append(buffer, bufferSize, "=<str>");
280 break;
281 }
282
283 return buffer;
284 }
285
286 static const CommandLineCommand* FindCommandFor(const CommandLineCommand* commands, CommandLineArgEnumerator* argEnumerator)
287 {

Callers 1

PrintOptionsFunction · 0.85

Calls 2

appendFormatFunction · 0.85
appendFunction · 0.50

Tested by

no test coverage detected