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:
@@ -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 ())
|
||||
|
||||
Reference in New Issue
Block a user