lib/cli: ArgumentsParser constructor can accept both char** and const char**

BodgeMaster-unfinished
BodgeMaster 2022-07-15 13:49:43 +02:00
parent 3b1d288d1e
commit 4c3d2fdbbf
2 changed files with 2 additions and 2 deletions

View File

@ -53,7 +53,7 @@ namespace CLI {
} }
// using int here bc that's how main() is defined // using int here bc that's how main() is defined
ArgumentsParser::ArgumentsParser(int argc, const char* argv[], std::vector<Flag> flags, std::vector<UnpositionalArgument> unpositionalArguments, std::vector<PositionalArgument> positionalArguments) { ArgumentsParser::ArgumentsParser(int argc, const char* const argv[], std::vector<Flag> flags, std::vector<UnpositionalArgument> unpositionalArguments, std::vector<PositionalArgument> positionalArguments) {
this->wrongUsage = false; this->wrongUsage = false;
this->wrongUsageMessages = std::vector<std::string>(); this->wrongUsageMessages = std::vector<std::string>();
this->programName = std::string(argv[0]); this->programName = std::string(argv[0]);

View File

@ -75,7 +75,7 @@ namespace CLI {
std::vector<std::string> wrongUsageMessages; std::vector<std::string> wrongUsageMessages;
// using int here bc that's how main() is defined // using int here bc that's how main() is defined
ArgumentsParser(int argc, const char* argv[], std::vector<Flag> flags, std::vector<UnpositionalArgument> unpositionalArguments, std::vector<PositionalArgument> positionalArguments); ArgumentsParser(int argc, const char* const argv[], std::vector<Flag> flags, std::vector<UnpositionalArgument> unpositionalArguments, std::vector<PositionalArgument> positionalArguments);
~ArgumentsParser(); ~ArgumentsParser();
ErrorOr<bool> getFlag(char shortName); ErrorOr<bool> getFlag(char shortName);