- Setting rc.debug implicitly sets debug.tls, debug.parser and debug.hooks.
This commit is contained in:
Paul Beckingham 2014-10-04 19:12:23 -04:00
parent c360923909
commit a71d4f1596
2 changed files with 23 additions and 0 deletions

View file

@ -150,6 +150,9 @@ int Context::initialize (int argc, const char** argv)
// Create missing config file and data directory, if necessary.
parser.applyOverrides ();
// Setting the debug switch has ripple effects.
propagateDebug ();
// These may have changed.
// TODO Uh oh.
Lexer::dateFormat = config.get ("dateformat");
@ -753,6 +756,25 @@ void Context::loadAliases ()
parser.alias (i->first.substr (6), i->second);
}
////////////////////////////////////////////////////////////////////////////////
// Using the general rc.debug setting automaticalls sets debug.tls, debug.hooks
// and debug.parser, unless they already have values, which by default they do
// not.
void Context::propagateDebug ()
{
if (config.getBoolean ("debug"))
{
if (! config.has ("debug.tls"))
config.set ("debug.tls", 2);
if (! config.has ("debug.hooks"))
config.set ("debug.hooks", 2);
if (! config.has ("debug.parser"))
config.set ("debug.parser", 2);
}
}
////////////////////////////////////////////////////////////////////////////////
void Context::header (const std::string& input)
{

View file

@ -79,6 +79,7 @@ private:
void updateXtermTitle ();
void updateVerbosity ();
void loadAliases ();
void propagateDebug ();
public:
std::string program;