From 14bea5e1b4c68032c1535e9a1f5bb014897aa310 Mon Sep 17 00:00:00 2001 From: Paul Beckingham Date: Sat, 14 May 2011 15:38:03 -0400 Subject: [PATCH] Verbose - The 'verbose' configuration variable now accepts a specific list of items to be verbose about. See taskrc(5). --- ChangeLog | 2 ++ NEWS | 2 +- doc/man/taskrc.5.in | 5 ++++- src/Config.cpp | 3 ++- src/Context.cpp | 11 ++++++----- src/columns/Column.cpp | 3 ++- 6 files changed, 17 insertions(+), 9 deletions(-) diff --git a/ChangeLog b/ChangeLog index acbedffc9..3bf46f424 100644 --- a/ChangeLog +++ b/ChangeLog @@ -30,6 +30,8 @@ + New 'color.label' for colorizing the report column labels. + The 'blanklines' configuration variable now replaced by the 'verbose' token 'blanklines'. + + The 'verbose' configuration variable now accepts a specific list of items to + be verbose about. See taskrc(5). # Tracked Features, sorted by ID. + Added feature #330, which supports the 'inverse' color attribute. diff --git a/NEWS b/NEWS index 0f4a670fd..2159e7eb2 100644 --- a/NEWS +++ b/NEWS @@ -15,7 +15,7 @@ New Features in taskwarrior 2.0.0 project, due date and description sorted by urgency). - Performance enhancements. - New 'next' report, that gauges urgency and reports the most urgent tasks. - - The 'blanklines' configuration variable replaced by 'verbose=...' tokens. + - Fine control of verbosity through the 'verbose=' configuration variable. Please refer to the ChangeLog file for full details. There are too many to list here. diff --git a/doc/man/taskrc.5.in b/doc/man/taskrc.5.in index 1d9bff505..50ad9d6aa 100644 --- a/doc/man/taskrc.5.in +++ b/doc/man/taskrc.5.in @@ -192,7 +192,10 @@ that you would see minimal output, with no help text. Alternatively, you can specify a comma-separated list of verbosity tokens that control specific occasions when output is generated. This list may contain: - blanklines Inserts extra blank lines in output, for clarity + blank Inserts extra blank lines in output, for clarity + header Messages that appear before report output + footnote Messages that appear after report output + label Column labels on tabular reports 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 42971d1e4..8ef274890 100644 --- a/src/Config.cpp +++ b/src/Config.cpp @@ -71,7 +71,8 @@ std::string Config::defaults = "# Miscellaneous\n" "verbose=yes # Provide extra feedback\n" "#verbose=no # Provide minimal feedback\n" - "#verbose=blanklines # Provide controlled feedback\n" + "#verbose=list # Comma-separated list. May contain:\n" + "#verbose=blank,header,footnote,label\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/Context.cpp b/src/Context.cpp index e534f6b08..9d047c35c 100644 --- a/src/Context.cpp +++ b/src/Context.cpp @@ -210,7 +210,7 @@ int Context::run () rc = 3; } - // Dump all debug messages. + // Dump all debug messages, controlled by rc.debug. if (config.getBoolean ("debug")) foreach (d, debugMessages) if (color ()) @@ -218,8 +218,8 @@ int Context::run () else std::cout << *d << "\n"; - // Dump all headers. - if (config.getBoolean ("verbose")) + // Dump all headers, controlled by 'header' verbosity token. + if (verbose ("header")) foreach (h, headers) if (color ()) std::cout << colorizeHeader (*h) << "\n"; @@ -229,8 +229,8 @@ int Context::run () // Dump the report output. std::cout << output; - // Dump all footnotes. - if (config.getBoolean ("verbose")) + // Dump all footnotes, controlled by 'footnote' verbosity token. + if (verbose ("footnote")) foreach (f, footnotes) if (color ()) std::cout << colorizeFootnote (*f) << "\n"; @@ -355,6 +355,7 @@ bool Context::color () } //////////////////////////////////////////////////////////////////////////////// +// TODO Support verbosity levels. bool Context::verbose (const std::string& token) { if (! verbosity.size ()) diff --git a/src/columns/Column.cpp b/src/columns/Column.cpp index 126bbb2d5..a199f0873 100644 --- a/src/columns/Column.cpp +++ b/src/columns/Column.cpp @@ -147,7 +147,8 @@ void Column::renderHeader ( int width, Color& color) { - if (_label != "") + if (context.verbose ("label") && + _label != "") { // Create a basic label. std::string header;