summaryrefslogtreecommitdiff
path: root/src/option_parser.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/option_parser.cc')
-rw-r--r--src/option_parser.cc13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/option_parser.cc b/src/option_parser.cc
index 4133d15..4fa2343 100644
--- a/src/option_parser.cc
+++ b/src/option_parser.cc
@@ -37,6 +37,8 @@
#include <list>
#include <map>
#include <string.h>
+#include "option_parser.h"
+
using namespace std;
@@ -203,7 +205,7 @@ public:
p_option->assignDefault(optionDefault);
}
- void ParseCommandLine(int argc, const char * const argv[])
+ void ParseCommandLine(int argc, const char * const argv[])
{
for (int i = 1; i < argc; i++) {
OptionMap::iterator i_option;
@@ -230,11 +232,11 @@ public:
fprintf(stderr, "\n\nGPGPU-Sim ** ERROR: Missing filename for option '-config'.\n");
exit(1);
}
+
ParseFile(argv[i + 1]);
i += 1;
optionFound = true;
}
-
if (optionFound == false) {
fprintf(stderr, "\n\nGPGPU-Sim ** ERROR: Unknown Option: '%s' \n", argv[i]);
exit(1);
@@ -242,6 +244,7 @@ public:
}
}
+
void ParseFile(const char *filename) {
ifstream inputFile;
stringstream args;
@@ -384,12 +387,14 @@ void option_parser_register(option_parser_t opp,
}
void option_parser_cmdline(option_parser_t opp,
- int argc, const char *argv[])
+ int argc, const char *argv[])
{
OptionParser *p_opr = reinterpret_cast<OptionParser *>(opp);
- p_opr->ParseCommandLine(argc,argv);
+ return p_opr->ParseCommandLine(argc,argv);
+
}
+
void option_parser_cfgfile(option_parser_t opp,
const char *filename)
{