MCPcopy Create free account
hub / github.com/Arm-Examples/ML-examples / AddOption

Function AddOption

ethos-u-corstone-1000/app/src/common/CliOptions.cpp:92–106  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

90}
91
92void 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
108const CliOptionSpec* FindEnabledOptionSpec(const CliOptionsConfig& config, int getoptValue)
109{

Callers 1

ParseCliOptionsFunction · 0.85

Calls 1

ToGetoptArgumentFunction · 0.85

Tested by

no test coverage detected