- Fixed bug whereby rc: and rc. processing ignored the -- argument.
This commit is contained in:
Paul Beckingham 2009-07-05 00:06:41 -04:00
parent 6f318ecdcf
commit 605eb397fc

View file

@ -309,13 +309,17 @@ void Context::loadCorrectConfigFile ()
// Is there an override for rc? // Is there an override for rc?
foreach (arg, args) foreach (arg, args)
if (arg->substr (0, 3) == "rc:") {
if (*arg == "--")
break;
else if (arg->substr (0, 3) == "rc:")
{ {
rc = arg->substr (3, std::string::npos); rc = arg->substr (3, std::string::npos);
args.erase (arg); args.erase (arg);
header ("Using alternate .taskrc file " + rc); // TODO i18n header ("Using alternate .taskrc file " + rc); // TODO i18n
break; break;
} }
}
// Load rc file. // Load rc file.
config.clear (); // Dump current values. config.clear (); // Dump current values.
@ -327,12 +331,16 @@ void Context::loadCorrectConfigFile ()
// Is there an override for data? // Is there an override for data?
foreach (arg, args) foreach (arg, args)
if (arg->substr (0, 17) == "rc.data.location:") {
if (*arg == "--")
break;
else if (arg->substr (0, 17) == "rc.data.location:")
{ {
data = arg->substr (17, std::string::npos); data = arg->substr (17, std::string::npos);
header ("Using alternate data.location " + data); // TODO i18n header ("Using alternate data.location " + data); // TODO i18n
break; break;
} }
}
// Do we need to create a default rc? // Do we need to create a default rc?
if (access (rc.c_str (), F_OK) && if (access (rc.c_str (), F_OK) &&
@ -356,7 +364,9 @@ void Context::loadCorrectConfigFile ()
std::vector <std::string> filtered; std::vector <std::string> filtered;
foreach (arg, args) foreach (arg, args)
{ {
if (arg->substr (0, 3) == "rc.") if (*arg == "--")
break;
else if (arg->substr (0, 3) == "rc.")
{ {
std::string name; std::string name;
std::string value; std::string value;