diff --git a/doc/man/taskrc.5.in b/doc/man/taskrc.5.in index 64a280bd6..64cfecc76 100644 --- a/doc/man/taskrc.5.in +++ b/doc/man/taskrc.5.in @@ -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. diff --git a/src/Config.cpp b/src/Config.cpp index 884107493..b527867b3 100644 --- a/src/Config.cpp +++ b/src/Config.cpp @@ -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" diff --git a/src/commands/CmdAdd.cpp b/src/commands/CmdAdd.cpp index 68dc37460..8875ed74b 100644 --- a/src/commands/CmdAdd.cpp +++ b/src/commands/CmdAdd.cpp @@ -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)); diff --git a/src/commands/CmdDuplicate.cpp b/src/commands/CmdDuplicate.cpp index b3baf4ebf..46abb922a 100644 --- a/src/commands/CmdDuplicate.cpp +++ b/src/commands/CmdDuplicate.cpp @@ -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)); } diff --git a/src/main.h b/src/main.h index ebe3347cc..52d96b3c3 100644 --- a/src/main.h +++ b/src/main.h @@ -28,8 +28,6 @@ #define INCLUDED_MAIN #define L10N // Localization complete. -#define FEATURE_NEW_ID 1 // Echoes back new id. - #include #include #include