From 3a07b7e1419be7459ba8ff396634e0b713e3f138 Mon Sep 17 00:00:00 2001 From: Pranav Srinivas Kumar Date: Sat, 30 Mar 2019 11:27:26 -0400 Subject: [PATCH] Removed old parse_args. Added default function for Argument.mAction --- src/argparse.hpp | 22 ---------------------- 1 file changed, 22 deletions(-) diff --git a/src/argparse.hpp b/src/argparse.hpp index ced832d..05ed881 100644 --- a/src/argparse.hpp +++ b/src/argparse.hpp @@ -103,28 +103,6 @@ class ArgumentParser { } void parse_args(int argc, char * argv[]) { - for (int i = 1; i < argc; i++) { - for (auto& tArgument : mArguments) { - auto tIndex = std::find(tArgument->mNames.begin(), tArgument->mNames.end(), argv[i]); - if (tIndex != tArgument->mNames.end()) { - i = i + 1; - if (i < argc) { - tArgument->mRawValue = argv[i]; - if (tArgument->mAction != nullptr) - tArgument->mValue = tArgument->mAction(argv[i]); - else { - if (tArgument->mDefaultValue != nullptr) - tArgument->mValue = tArgument->mDefaultValue(); - else - tArgument->mValue = std::string(argv[i]); - } - } - } - } - } - } - - void parse_args_2(int argc, char * argv[]) { for (int i = 1; i < argc; i++) { auto tCurrentArgument = argv[i]; std::map>::iterator tIterator = mArgumentMap.find(argv[i]);