| 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 | { |
no test coverage detected