Verbosity

- Implemented new verbosity token 'new-id' which controls whether
  newly generated task IDs are reported.
This commit is contained in:
Paul Beckingham 2011-07-10 10:08:23 -04:00
parent 3456a24749
commit ad55fa2d79
5 changed files with 12 additions and 13 deletions

View file

@ -195,10 +195,10 @@ help text.
.SS MISCELLANEOUS
.TP
.B edit.verbose=on|off|list...
When set to on (the default), helpful explanatory comments are added to the
edited file when using the "task edit ..." command. Setting this to off means
that you would see minimal output, with no help text.
.B verbose=on|off|list...
When set to on (the default), helpful explanatory comments are added to all
output from Taskwarrior. Setting this to off means that you would see minimal
output.
Alternatively, you can specify a comma-separated list of verbosity tokens that
control specific occasions when output is generated. This list may contain:
@ -207,6 +207,7 @@ control specific occasions when output is generated. This list may contain:
header Messages that appear before report output
footnote Messages that appear after report output
label Column labels on tabular reports
new-id Provides feedback of any new task IDs
Note that the "on" setting is equivalent to all the tokens being specified,
and the "off" setting is equivalent to none of the tokens being specified.

View file

@ -76,10 +76,10 @@ std::string Config::defaults =
"edit.verbose=yes # Include comments in files created during task edit\n"
"\n"
"# Miscellaneous\n"
"verbose=yes # Provide extra feedback\n"
"verbose=yes # Provide maximal feedback\n"
"#verbose=no # Provide minimal feedback\n"
"#verbose=list # Comma-separated list. May contain:\n"
"#verbose=blank,header,footnote,label\n"
"#verbose=list # Comma-separated list. May contain any subset of:\n"
"#verbose=blank,header,footnote,label,new-id\n"
"confirmation=yes # Confirmation on delete, big changes\n"
"echo.command=yes # Details on command just run\n"
"annotations=full # Level of verbosity for annotations: full, sparse or none\n"

View file

@ -72,9 +72,8 @@ int CmdAdd::execute (std::string& output)
context.tdb.add (task);
// TODO This should be a call in to feedback.cpp.
#ifdef FEATURE_NEW_ID
output = format (STRING_CMD_ADD_FEEDBACK, context.tdb.nextId ()) + "\n";
#endif
if (context.verbose ("new-id"))
output = format (STRING_CMD_ADD_FEEDBACK, context.tdb.nextId ()) + "\n";
context.footnote (onProjectChange (task));

View file

@ -110,7 +110,8 @@ int CmdDuplicate::execute (std::string& output)
<< "'.\n";
// TODO This should be a call in to feedback.cpp.
out << format (STRING_CMD_ADD_FEEDBACK, context.tdb.nextId ()) + "\n";
if (context.verbose ("new-id"))
out << format (STRING_CMD_ADD_FEEDBACK, context.tdb.nextId ()) + "\n";
context.footnote (onProjectChange (dup));
}

View file

@ -28,8 +28,6 @@
#define INCLUDED_MAIN
#define L10N // Localization complete.
#define FEATURE_NEW_ID 1 // Echoes back new id.
#include <string>
#include <vector>
#include <map>