diff --git a/AUTHORS b/AUTHORS index b833ae142..9d43a11b0 100644 --- a/AUTHORS +++ b/AUTHORS @@ -218,4 +218,4 @@ suggestions: Steffen Uhlig Dirk Sarpe Will Dietz - + Charles Ulrich diff --git a/ChangeLog b/ChangeLog index 46f521a23..f5d7aff01 100644 --- a/ChangeLog +++ b/ChangeLog @@ -97,6 +97,8 @@ - TW-1321 Unit test view.t fails oddly on Ubuntu 13.10 (thanks to John West). - TW-1324 Numeric UDAs are compared as strings (thanks to Ben Boeckel). - TW-1331 date more than 5 years away is faulty (thanks to Onion). +- TW-1341 confirmation config setting should apply to config command as well + (thanks to Charles Ulrich). - TW-1345 taskrc.5 manpage errors. - TW-1361 Strange results with complex filter (thanks to Jim B). - Removed deprecated 'echo.command' setting, in favor of the 'header' and diff --git a/src/commands/CmdConfig.cpp b/src/commands/CmdConfig.cpp index a87aadacb..1380f9d64 100644 --- a/src/commands/CmdConfig.cpp +++ b/src/commands/CmdConfig.cpp @@ -61,6 +61,8 @@ int CmdConfig::execute (std::string& output) // task config name # remove name if (words.size ()) { + bool confirmation = context.config.getBoolean ("confirmation"); + std::string name = words[0]; std::string value = ""; @@ -100,7 +102,8 @@ int CmdConfig::execute (std::string& output) comment > pos)) { found = true; - if (confirm (format (STRING_CMD_CONFIG_CONFIRM, name, context.config.get (name), value))) + if (!confirmation || + confirm (format (STRING_CMD_CONFIG_CONFIRM, name, context.config.get (name), value))) { if (comment != std::string::npos) *line = name + "=" + json::encode (value) + " " + line->substr (comment); @@ -114,7 +117,8 @@ int CmdConfig::execute (std::string& output) // Not found, so append instead. if (!found && - confirm (format (STRING_CMD_CONFIG_CONFIRM2, name, value))) + (!confirmation || + confirm (format (STRING_CMD_CONFIG_CONFIRM2, name, value)))) { contents.push_back (name + "=" + json::encode (value)); change = true; @@ -139,7 +143,8 @@ int CmdConfig::execute (std::string& output) found = true; // Remove name - if (confirm (format (STRING_CMD_CONFIG_CONFIRM3, name))) + if (!confirmation || + confirm (format (STRING_CMD_CONFIG_CONFIRM3, name))) { *line = ""; change = true;