Browse Source

Util: Add ArgParser::parse overload for C legacy

master
Riyyi 2 years ago
parent
commit
6cd2fe4e9a
  1. 5
      src/ruc/argparser.cpp
  2. 1
      src/ruc/argparser.h

5
src/ruc/argparser.cpp

@ -259,6 +259,11 @@ bool ArgParser::parseArgument(std::string_view argument)
} }
bool ArgParser::parse(int argc, const char* argv[]) bool ArgParser::parse(int argc, const char* argv[])
{
return parse(argc, const_cast<char**>(argv));
}
bool ArgParser::parse(int argc, char* argv[])
{ {
bool result = true; bool result = true;

1
src/ruc/argparser.h

@ -63,6 +63,7 @@ public:
}; };
bool parse(int argc, const char* argv[]); bool parse(int argc, const char* argv[]);
bool parse(int argc, char* argv[]);
void addOption(Option&& option); void addOption(Option&& option);
void addOption(bool& value, char shortName, const char* longName, const char* usageString, const char* manString); void addOption(bool& value, char shortName, const char* longName, const char* usageString, const char* manString);

Loading…
Cancel
Save