mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-07-07 20:06:36 +02:00
Context
- Restructured code that handles initialization failure, which was checking the rc value at each step, which is not necessary and confusing.
This commit is contained in:
parent
d290b8792b
commit
f0a2f0d70e
1 changed files with 36 additions and 35 deletions
|
@ -225,8 +225,11 @@ int Context::initialize (int argc, const char** argv)
|
|||
rc = 3;
|
||||
}
|
||||
|
||||
// On initialization failure...
|
||||
if (rc)
|
||||
{
|
||||
// Dump all debug messages, controlled by rc.debug.
|
||||
if (rc && config.getBoolean ("debug"))
|
||||
if (config.getBoolean ("debug"))
|
||||
{
|
||||
std::vector <std::string>::iterator d;
|
||||
for (d = debugMessages.begin (); d != debugMessages.end (); ++d)
|
||||
|
@ -237,7 +240,7 @@ int Context::initialize (int argc, const char** argv)
|
|||
}
|
||||
|
||||
// Dump all headers, controlled by 'header' verbosity token.
|
||||
if (rc && verbose ("header"))
|
||||
if (verbose ("header"))
|
||||
{
|
||||
std::vector <std::string>::iterator h;
|
||||
for (h = headers.begin (); h != headers.end (); ++h)
|
||||
|
@ -248,7 +251,7 @@ int Context::initialize (int argc, const char** argv)
|
|||
}
|
||||
|
||||
// Dump all footnotes, controlled by 'footnote' verbosity token.
|
||||
if (rc && verbose ("footnote"))
|
||||
if (verbose ("footnote"))
|
||||
{
|
||||
std::vector <std::string>::iterator f;
|
||||
for (f = footnotes.begin (); f != footnotes.end (); ++f)
|
||||
|
@ -260,8 +263,6 @@ int Context::initialize (int argc, const char** argv)
|
|||
|
||||
// Dump all errors, non-maskable.
|
||||
// Colorized as footnotes.
|
||||
if (rc)
|
||||
{
|
||||
std::vector <std::string>::iterator e;
|
||||
for (e = errors.begin (); e != errors.end (); ++e)
|
||||
if (color ())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue