mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-06-26 10:54:26 +02:00
Context
- Setting rc.debug implicitly sets debug.tls, debug.parser and debug.hooks.
This commit is contained in:
parent
c360923909
commit
a71d4f1596
2 changed files with 23 additions and 0 deletions
|
@ -150,6 +150,9 @@ int Context::initialize (int argc, const char** argv)
|
||||||
// Create missing config file and data directory, if necessary.
|
// Create missing config file and data directory, if necessary.
|
||||||
parser.applyOverrides ();
|
parser.applyOverrides ();
|
||||||
|
|
||||||
|
// Setting the debug switch has ripple effects.
|
||||||
|
propagateDebug ();
|
||||||
|
|
||||||
// These may have changed.
|
// These may have changed.
|
||||||
// TODO Uh oh.
|
// TODO Uh oh.
|
||||||
Lexer::dateFormat = config.get ("dateformat");
|
Lexer::dateFormat = config.get ("dateformat");
|
||||||
|
@ -753,6 +756,25 @@ void Context::loadAliases ()
|
||||||
parser.alias (i->first.substr (6), i->second);
|
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)
|
void Context::header (const std::string& input)
|
||||||
{
|
{
|
||||||
|
|
|
@ -79,6 +79,7 @@ private:
|
||||||
void updateXtermTitle ();
|
void updateXtermTitle ();
|
||||||
void updateVerbosity ();
|
void updateVerbosity ();
|
||||||
void loadAliases ();
|
void loadAliases ();
|
||||||
|
void propagateDebug ();
|
||||||
|
|
||||||
public:
|
public:
|
||||||
std::string program;
|
std::string program;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue