diff --git a/src/commands/CmdConfig.cpp b/src/commands/CmdConfig.cpp index f21e8f00..dac09039 100644 --- a/src/commands/CmdConfig.cpp +++ b/src/commands/CmdConfig.cpp @@ -39,7 +39,7 @@ // Note that because this function does not recurse with includes, it therefore // only sees the top-level settings. This has the desirable effect of adding as // an override any setting which resides in an imported file. -static bool setConfigVariable (const Rules& rules, std::string name, std::string value, bool confirmation /* = false */) +static bool setConfigVariable (Database& database, const Rules& rules, std::string name, std::string value, bool confirmation /* = false */) { // Read config file as lines of text. std::vector lines; @@ -140,7 +140,7 @@ static bool setConfigVariable (const Rules& rules, std::string name, std::string // 0 - found and removed // 1 - found and not removed // 2 - not found -static int unsetConfigVariable (const Rules& rules, std::string name, bool confirmation /* = false */) +static int unsetConfigVariable (Database& database, const Rules& rules, std::string name, bool confirmation /* = false */) { // Setting not found. if (! rules.has (name)) @@ -218,7 +218,8 @@ static int unsetConfigVariable (const Rules& rules, std::string name, bool confi // timew config Show all config int CmdConfig ( const CLI& cli, - Rules& rules) + Rules& rules, + Database& database) { int rc = 0; @@ -255,7 +256,7 @@ int CmdConfig ( // task config name "" if (words.size () > 1) { - change = setConfigVariable (rules, name, value, confirmation); + change = setConfigVariable (database, rules, name, value, confirmation); if (! change) rc = 1; } @@ -264,7 +265,7 @@ int CmdConfig ( else { bool found = false; - rc = unsetConfigVariable (rules, name, confirmation); + rc = unsetConfigVariable (database, rules, name, confirmation); if (rc == 0) { change = true; diff --git a/src/commands/commands.h b/src/commands/commands.h index 3f598762..5ea027b2 100644 --- a/src/commands/commands.h +++ b/src/commands/commands.h @@ -34,7 +34,7 @@ int CmdCancel ( Rules&, Database& ); int CmdClear (const CLI&, Rules&, Database& ); -int CmdConfig (const CLI&, Rules& ); +int CmdConfig (const CLI&, Rules&, Database& ); int CmdContinue ( Rules&, Database& ); int CmdDefault ( Rules&, Database& ); int CmdDiagnostics ( Rules&, Database&, const Extensions&); diff --git a/src/init.cpp b/src/init.cpp index f6c8ced7..21138820 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -228,7 +228,7 @@ int dispatchCommand ( // command to fn mapping. if (command == "cancel") status = CmdCancel ( rules, database ); else if (command == "clear") status = CmdClear (cli, rules, database ); - else if (command == "config") status = CmdConfig (cli, rules ); + else if (command == "config") status = CmdConfig (cli, rules, database ); else if (command == "continue") status = CmdContinue ( rules, database ); else if (command == "day") status = CmdReportDay (cli, rules, database ); else if (command == "diagnostics") status = CmdDiagnostics ( rules, database, extensions);