mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-07-30 13:33:24 +02:00
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?
This commit is contained in:
parent
d7bded0d73
commit
99641e7b0b
1 changed files with 7 additions and 6 deletions
|
@ -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 <std::string> 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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue