diff --git a/ChangeLog b/ChangeLog index 82ac14fbd..000d2c83c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -20,6 +20,8 @@ Chris Pride). + Custom reports now support a more compact form of the "age" column, called "age_compact" (thanks to T. Charles Yun). + + Supports 'rc.name:value' for a command line override to .taskrc data + (thanks to Federico Hernandez). + Removed obsolete DEVELOPERS file. The online support forums at http://taskwarrior.org will provide better information. + Replaced website references with http://taskwarrior.org. diff --git a/src/Context.cpp b/src/Context.cpp index 2ac9ddb5e..c44d13480 100644 --- a/src/Context.cpp +++ b/src/Context.cpp @@ -201,13 +201,11 @@ void Context::loadCorrectConfigFile () if (arg->substr (0, 3) == "rc:") { std::string file = arg->substr (3, std::string::npos); - if (! access (file.c_str (), F_OK)) - { - config.load (file); - return; - } - else + if (access (file.c_str (), F_OK)) throw std::string ("Could not read configuration file '") + file + "'"; + + messages.push_back (std::string ("Using alternate .taskrc file ") + file); // TODO i18n + config.load (file); } } @@ -221,8 +219,6 @@ void Context::loadCorrectConfigFile () config.createDefault (file); // Apply overrides of type: "rc.name:value" -/* - // TODO Maybe this should happen after the parse? foreach (arg, args) { if (arg->substr (0, 3) == "rc.") @@ -237,10 +233,11 @@ void Context::loadCorrectConfigFile () n.getUntilEOS (value)) { config.set (name, value); + messages.push_back (std::string ("Configuration override ") + // TODO i18n + arg->substr (3, std::string::npos)); } } } -*/ } //////////////////////////////////////////////////////////////////////////////// @@ -258,7 +255,8 @@ void Context::parse () { // Ignore any argument that is "rc:...", because that is the command line // specified rc file. - if (arg->substr (0, 3) != "rc:") + if (arg->substr (0, 3) != "rc:" || + arg->substr (0, 3) != "rc.") { if (!terminated) { diff --git a/src/task.cpp b/src/task.cpp index 834fc2a43..7dd33a9af 100644 --- a/src/task.cpp +++ b/src/task.cpp @@ -265,7 +265,12 @@ static std::string longUsage () << " until: Recurrence end date" << "\n" << " fg: Foreground color" << "\n" << " bg: Background color" << "\n" - << " rc: Alternate .taskrc file" << "\n" + << "\n" + << "The default .taskrc file can be overridden with:" << "\n" + << " task rc: ..." << "\n" + << "\n" + << "The values in .taskrc (or alternate) can be overridden with:" << "\n" + << " task ... rc.:" << "\n" << "\n" << "Any command or attribute name may be abbreviated if still unique:" << "\n" << " task list project:Home" << "\n"