diff --git a/src/Parser.cpp b/src/Parser.cpp index 6d5c48356..1a73bae97 100644 --- a/src/Parser.cpp +++ b/src/Parser.cpp @@ -62,6 +62,26 @@ Parser::~Parser () delete _tree; } +//////////////////////////////////////////////////////////////////////////////// +// Static method. +void Parser::getOverrides ( + int argc, + const char** argv, + std::string& rc_file) +{ + for (int i = 0; i < argc; ++i) + { + std::string raw = argv[i]; + if (raw.length () > 3 && + raw.substr (0, 3) == "rc:") + { + rc_file = raw.substr (3); + } + + // Keep looping, so we capture the last one. + } +} + //////////////////////////////////////////////////////////////////////////////// // char** argv --> std::vector _args void Parser::initialize (int argc, const char** argv) diff --git a/src/Parser.h b/src/Parser.h index 769c7051f..5180987ee 100644 --- a/src/Parser.h +++ b/src/Parser.h @@ -37,6 +37,9 @@ class Parser public: Parser (); ~Parser (); + + static void getOverrides (int, const char**, std::string&); + void initialize (int, const char**); void clear (); void appendStdin ();