From 99641e7b0bbba350146b0a509416180790cd6b25 Mon Sep 17 00:00:00 2001 From: Paul Beckingham Date: Sat, 10 Oct 2009 11:15:32 -0400 Subject: [PATCH] Enhancement - rc.name=value - Task now supports both "rc.name:value" and "rc.name=value", not because this is generally a good idea, but because it is a very common mistake that we are all making, and shouldn't the software be forgiving in an unambiguous case like this? --- src/Context.cpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/Context.cpp b/src/Context.cpp index 81ee76b8c..0af808204 100644 --- a/src/Context.cpp +++ b/src/Context.cpp @@ -384,7 +384,8 @@ void Context::loadCorrectConfigFile () { if (*arg == "--") break; - else if (arg->substr (0, 17) == "rc.data.location:") + else if (arg->substr (0, 17) == "rc.data.location:" || + arg->substr (0, 17) == "rc.data.location=") { data = arg->substr (17, std::string::npos); header ("Using alternate data.location " + data); // TODO i18n @@ -416,7 +417,7 @@ void Context::loadCorrectConfigFile () config.setDefaults (); // Add in the custom reports. config.load (rc); // Load new file. - // Apply overrides of type: "rc.name:value" + // Apply overrides of type: "rc.name:value", or "rc.name=value". std::vector filtered; bool foundTerminator = false; foreach (arg, args) @@ -432,10 +433,10 @@ void Context::loadCorrectConfigFile () std::string name; std::string value; Nibbler n (*arg); - if (n.getUntil ('.', name) && - n.skip ('.') && - n.getUntil (':', name) && - n.skip (':') && + if (n.getUntil ('.', name) && + n.skip ('.') && + n.getUntilOneOf (":=", name) && + n.skipN (1) && n.getUntilEOS (value)) { config.set (name, value);