- Implemented ::isConfigOverride, and used it.
This commit is contained in:
Paul Beckingham 2014-10-27 13:40:32 -04:00
parent 91f4eade50
commit d5e6aa7640
2 changed files with 16 additions and 5 deletions

View file

@ -477,9 +477,10 @@ const std::string CLI::dump () const
void CLI::addArg (const std::string& arg) void CLI::addArg (const std::string& arg)
{ {
// Do not lex RC overrides. // Do not lex RC overrides.
if (arg.length () > 3 && if (isRCOverride (arg))
(arg.substr (0, 3) == "rc." || _original_args.push_back (arg);
arg.substr (0, 3) == "rc:"))
if (isConfigOverride (arg))
_original_args.push_back (arg); _original_args.push_back (arg);
// Do not lex patterns or single substitutions. // Do not lex patterns or single substitutions.
@ -601,12 +602,12 @@ void CLI::findOverrides ()
if (terminated) if (terminated)
continue; continue;
if (raw.find ("rc:") == 0) if (isRCOverride (raw))
{ {
a->tag ("RC"); a->tag ("RC");
a->attribute ("file", raw.substr (3)); a->attribute ("file", raw.substr (3));
} }
else if (raw.find ("rc.") == 0) else if (isConfigOverride (raw))
{ {
std::string::size_type sep = raw.find ('=', 3); std::string::size_type sep = raw.find ('=', 3);
if (sep == std::string::npos) if (sep == std::string::npos)
@ -1700,6 +1701,15 @@ bool CLI::isRCOverride (const std::string& raw) const
return false; return false;
} }
////////////////////////////////////////////////////////////////////////////////
bool CLI::isConfigOverride (const std::string& raw) const
{
if (raw.length () > 3 && raw.substr (0, 3) == "rc.")
return true;
return false;
}
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
bool CLI::isUUID (const std::string& raw) const bool CLI::isUUID (const std::string& raw) const
{ {

View file

@ -99,6 +99,7 @@ private:
void decomposeModSubstitutions (); void decomposeModSubstitutions ();
bool isRCOverride (const std::string&) const; bool isRCOverride (const std::string&) const;
bool isConfigOverride (const std::string&) const;
bool isUUID (const std::string&) const; bool isUUID (const std::string&) const;
public: public: