| 90 | } |
| 91 | |
| 92 | void AddOption(std::vector<option>& options, std::string& optionString, const CliOptionSpec& spec) |
| 93 | { |
| 94 | const int hasArg = ToGetoptArgument(spec.argument); |
| 95 | options.push_back({spec.longOpt, hasArg, nullptr, spec.getoptValue}); |
| 96 | if (spec.aliasLongOpt != nullptr) { |
| 97 | options.push_back({spec.aliasLongOpt, hasArg, nullptr, spec.getoptValue}); |
| 98 | } |
| 99 | |
| 100 | if (spec.shortOpt != '\0') { |
| 101 | optionString.push_back(spec.shortOpt); |
| 102 | if (spec.argument == CliOptionArgument::kRequired) { |
| 103 | optionString.push_back(':'); |
| 104 | } |
| 105 | } |
| 106 | } |
| 107 | |
| 108 | const CliOptionSpec* FindEnabledOptionSpec(const CliOptionsConfig& config, int getoptValue) |
| 109 | { |
no test coverage detected