From c7cd2d2619c1eaf72f90a56c273c380035915589 Mon Sep 17 00:00:00 2001 From: Paul Beckingham Date: Tue, 10 Aug 2010 22:10:01 -0400 Subject: [PATCH] Bug #460 - Added rc.verbose that for now, just controls whether header and footer messages are displayed, but will ultimately control much more. --- doc/man/taskrc.5 | 13 ++++++++++--- src/Config.cpp | 1 + src/Context.cpp | 22 ++++++++++++---------- 3 files changed, 23 insertions(+), 13 deletions(-) diff --git a/doc/man/taskrc.5 b/doc/man/taskrc.5 index 6370c7f7e..f7fef42af 100644 --- a/doc/man/taskrc.5 +++ b/doc/man/taskrc.5 @@ -27,7 +27,7 @@ $ task rc:/.taskrc .RE Individual option can be overridden by using the -.I rc.: +.I rc.: attribute when running task: .RS @@ -109,7 +109,8 @@ statement: include .RE -By using include files you can divide your main configuration file into several ones containing just the relevant configuration data like colors, etc. +By using include files you can divide your main configuration file into several +ones containing just the relevant configuration data like colors, etc. There are two excellent uses of includes in your .taskrc, shown here: @@ -172,6 +173,10 @@ code. If not specified, task will assume en-US. If specified, task will locate the correct file of localized strings and proceed. It is an error to specify a locale for which there is no strings file. +.TP +.B verbose=yes +Controls some of the verbosity of task. + .TP .B confirmation=yes May be "yes" or "no", and determines whether task will ask for confirmation @@ -476,7 +481,9 @@ variable. .RE .RS -The following holidays are computed automatically: Good Friday (goodfriday), Easter (easter), Easter monday (eastermonday), Ascension (ascension), Pentecost (pentecost). The date for these holidays is the given keyword: +The following holidays are computed automatically: Good Friday (goodfriday), +Easter (easter), Easter monday (eastermonday), Ascension (ascension), Pentecost +(pentecost). The date for these holidays is the given keyword: .RE .RS diff --git a/src/Config.cpp b/src/Config.cpp index 70f52d238..be9773ab0 100644 --- a/src/Config.cpp +++ b/src/Config.cpp @@ -67,6 +67,7 @@ std::string Config::defaults = "#editor=vi # Preferred text editor\n" "\n" "# Miscellaneous\n" + "verbose=yes # Provide extra feedback\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 37a606d60..f5c53f241 100644 --- a/src/Context.cpp +++ b/src/Context.cpp @@ -170,11 +170,12 @@ int Context::run () // Dump all headers. hooks.trigger ("pre-header"); - foreach (h, headers) - if (config.getBoolean ("color") || config.getBoolean ("_forcecolor")) - std::cout << colorizeHeader (*h) << std::endl; - else - std::cout << *h << std::endl; + if (config.getBoolean ("verbose")) + foreach (h, headers) + if (config.getBoolean ("color") || config.getBoolean ("_forcecolor")) + std::cout << colorizeHeader (*h) << std::endl; + else + std::cout << *h << std::endl; hooks.trigger ("post-header"); // Dump the report output. @@ -184,11 +185,12 @@ int Context::run () // Dump all footnotes. hooks.trigger ("pre-footnote"); - foreach (f, footnotes) - if (config.getBoolean ("color") || config.getBoolean ("_forcecolor")) - std::cout << colorizeFootnote (*f) << std::endl; - else - std::cout << *f << std::endl; + if (config.getBoolean ("verbose")) + foreach (f, footnotes) + if (config.getBoolean ("color") || config.getBoolean ("_forcecolor")) + std::cout << colorizeFootnote (*f) << std::endl; + else + std::cout << *f << std::endl; hooks.trigger ("post-footnote"); hooks.trigger ("pre-exit");