TW-1341
- TW-1341 confirmation config setting should apply to config command as well (thanks to Charles Ulrich).
This commit is contained in:
2
AUTHORS
2
AUTHORS
@@ -218,4 +218,4 @@ suggestions:
|
|||||||
Steffen Uhlig
|
Steffen Uhlig
|
||||||
Dirk Sarpe
|
Dirk Sarpe
|
||||||
Will Dietz
|
Will Dietz
|
||||||
|
Charles Ulrich
|
||||||
|
|||||||
@@ -97,6 +97,8 @@
|
|||||||
- TW-1321 Unit test view.t fails oddly on Ubuntu 13.10 (thanks to John West).
|
- 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-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-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-1345 taskrc.5 manpage errors.
|
||||||
- TW-1361 Strange results with complex filter (thanks to Jim B).
|
- TW-1361 Strange results with complex filter (thanks to Jim B).
|
||||||
- Removed deprecated 'echo.command' setting, in favor of the 'header' and
|
- Removed deprecated 'echo.command' setting, in favor of the 'header' and
|
||||||
|
|||||||
@@ -61,6 +61,8 @@ int CmdConfig::execute (std::string& output)
|
|||||||
// task config name # remove name
|
// task config name # remove name
|
||||||
if (words.size ())
|
if (words.size ())
|
||||||
{
|
{
|
||||||
|
bool confirmation = context.config.getBoolean ("confirmation");
|
||||||
|
|
||||||
std::string name = words[0];
|
std::string name = words[0];
|
||||||
std::string value = "";
|
std::string value = "";
|
||||||
|
|
||||||
@@ -100,7 +102,8 @@ int CmdConfig::execute (std::string& output)
|
|||||||
comment > pos))
|
comment > pos))
|
||||||
{
|
{
|
||||||
found = true;
|
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)
|
if (comment != std::string::npos)
|
||||||
*line = name + "=" + json::encode (value) + " " + line->substr (comment);
|
*line = name + "=" + json::encode (value) + " " + line->substr (comment);
|
||||||
@@ -114,7 +117,8 @@ int CmdConfig::execute (std::string& output)
|
|||||||
|
|
||||||
// Not found, so append instead.
|
// Not found, so append instead.
|
||||||
if (!found &&
|
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));
|
contents.push_back (name + "=" + json::encode (value));
|
||||||
change = true;
|
change = true;
|
||||||
@@ -139,7 +143,8 @@ int CmdConfig::execute (std::string& output)
|
|||||||
found = true;
|
found = true;
|
||||||
|
|
||||||
// Remove name
|
// Remove name
|
||||||
if (confirm (format (STRING_CMD_CONFIG_CONFIRM3, name)))
|
if (!confirmation ||
|
||||||
|
confirm (format (STRING_CMD_CONFIG_CONFIRM3, name)))
|
||||||
{
|
{
|
||||||
*line = "";
|
*line = "";
|
||||||
change = true;
|
change = true;
|
||||||
|
|||||||
Reference in New Issue
Block a user