diff --git a/ChangeLog b/ChangeLog index a60b1ec08..b0cb0a284 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,6 +2,7 @@ - TW-1596 taskwarrior can't compile FreeBSD 9.3 32bit environment (thanks to ribbon) +- The 'obfuscate' setting, if set to '1' will replace all text with 'xxx'. ------ current release --------------------------- diff --git a/NEWS b/NEWS index 54dc175b2..649779e4a 100644 --- a/NEWS +++ b/NEWS @@ -10,7 +10,8 @@ New commands in taskwarrior 2.4.4 New configuration options in taskwarrior 2.4.4 - - + - The 'obfuscate' setting, if set to '1' will replace all text with 'xxx'. + This is useful when sharing data for bug reporting purposes. Newly deprecated features in taskwarrior 2.4.4 diff --git a/doc/man/taskrc.5.in b/doc/man/taskrc.5.in index 1d065dc63..6396b78a5 100644 --- a/doc/man/taskrc.5.in +++ b/doc/man/taskrc.5.in @@ -502,6 +502,12 @@ shows parse trees from every phase of the parse. Controls the GnuTLS diagnostic level. For 'sync' debugging. Level 0 means no diagnostics. Level 9 is the highest. Level 2 is a good setting for debugging. +.TP +.B obfuscate=1 +When set to '1', will replace all report text with 'xxx'. +This is useful for sharing report output in bug reports. +Default value is '0'. + .TP .B alias.rm=delete Taskwarrior supports command aliases. This alias provides an alternate name diff --git a/src/ViewTask.cpp b/src/ViewTask.cpp index 5fa90353e..f5caf7b9a 100644 --- a/src/ViewTask.cpp +++ b/src/ViewTask.cpp @@ -324,8 +324,9 @@ std::string ViewTask::render (std::vector & data, std::vector & seque max_lines = cells[c].size (); if (obfuscate) - for (unsigned int line = 0; line < cells[c].size (); ++line) - cells[c][line] = obfuscateText (cells[c][line]); + if (_columns[c]->type () == "string") + for (unsigned int line = 0; line < cells[c].size (); ++line) + cells[c][line] = obfuscateText (cells[c][line]); } // Listing breaks are simply blank lines inserted when a column value diff --git a/src/ViewText.cpp b/src/ViewText.cpp index adf03a46f..80b071b5f 100644 --- a/src/ViewText.cpp +++ b/src/ViewText.cpp @@ -269,8 +269,9 @@ std::string ViewText::render () max_lines = cells[col].size (); if (obfuscate) - for (unsigned int line = 0; line < cells[col].size (); ++line) - cells[col][line] = obfuscateText (cells[col][line]); + if (_columns[col]->type () == "string") + for (unsigned int line = 0; line < cells[col].size (); ++line) + cells[col][line] = obfuscateText (cells[col][line]); } for (unsigned int i = 0; i < max_lines; ++i) diff --git a/src/commands/CmdShow.cpp b/src/commands/CmdShow.cpp index 8b8039e16..239129a17 100644 --- a/src/commands/CmdShow.cpp +++ b/src/commands/CmdShow.cpp @@ -167,6 +167,7 @@ int CmdShow::execute (std::string& output) " locking" " monthsperline" " nag" + " obfuscate" " print.empty.columns" " recurrence" " recurrence.confirmation"