- Implemented rc.verbose=on|off|list...
- Migrated rc.blanklines to a verbosity token.
- Updated documentation.
This commit is contained in:
Paul Beckingham 2011-05-11 21:49:31 -04:00
parent adc8605b06
commit 5fa77a36de
12 changed files with 65 additions and 13 deletions

View file

@ -27,6 +27,7 @@
#include <iostream>
#include <fstream>
#include <algorithm>
#include <pwd.h>
#include <stdlib.h>
#include <string.h>
@ -57,6 +58,7 @@ Context::Context ()
, cmd ()
, dom ()
, use_color (true)
, verbosity_legacy (false)
, inShadow (false)
, terminal_width (0)
, terminal_height (0)
@ -327,6 +329,24 @@ bool Context::color ()
config.getBoolean ("_forcecolor");
}
////////////////////////////////////////////////////////////////////////////////
bool Context::verbose (const std::string& token)
{
if (! verbosity.size ())
{
verbosity_legacy = config.getBoolean ("verbose");
split (verbosity, config.get ("verbose"), ',');
}
if (verbosity_legacy)
return true;
if (std::find (verbosity.begin (), verbosity.end (), token) != verbosity.end ())
return true;
return false;
}
////////////////////////////////////////////////////////////////////////////////
void Context::shadow ()
{