- The 'verbose' configuration variable now accepts a specific list of items to
  be verbose about.  See taskrc(5).
This commit is contained in:
Paul Beckingham 2011-05-14 15:38:03 -04:00
parent 557440db0c
commit 14bea5e1b4
6 changed files with 17 additions and 9 deletions

View file

@ -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"

View file

@ -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 ())

View file

@ -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;