Enhancement
- Allow a separate color for error messages via the 'color.error' configuration variable.
This commit is contained in:
committed by
Paul Beckingham
parent
eaae2d84da
commit
e1407437e0
@@ -159,6 +159,7 @@ std::string Config::_defaults =
|
||||
#ifdef LINUX
|
||||
"color.header=color3 # Color of header messages\n"
|
||||
"color.footnote=color3 # Color of footnote messages\n"
|
||||
"color.error=color3 # Color of error messages\n"
|
||||
"color.debug=color3 # Color of diagnostic output\n"
|
||||
"color.alternate=on color233 # Alternate color for line coloring\n"
|
||||
"\n"
|
||||
@@ -211,6 +212,7 @@ std::string Config::_defaults =
|
||||
#else
|
||||
"color.header=yellow # Color of header messages\n"
|
||||
"color.footnote=yellow # Color of footnote messages\n"
|
||||
"color.error=yellow # Color of error messages\n"
|
||||
"color.debug=yellow # Color of diagnostic output\n"
|
||||
"color.alternate= # Alternate color for line coloring\n"
|
||||
"\n"
|
||||
|
||||
@@ -345,7 +345,7 @@ int Context::run ()
|
||||
std::vector <std::string>::iterator e;
|
||||
for (e = errors.begin (); e != errors.end (); ++e)
|
||||
if (color ())
|
||||
std::cerr << colorizeFootnote (*e) << "\n";
|
||||
std::cerr << colorizeError (*e) << "\n";
|
||||
else
|
||||
std::cerr << *e << "\n";
|
||||
|
||||
|
||||
@@ -100,6 +100,7 @@ int CmdShow::execute (std::string& output)
|
||||
" color.deleted"
|
||||
" color.due"
|
||||
" color.due.today"
|
||||
" color.error"
|
||||
" color.footnote"
|
||||
" color.header"
|
||||
" color.history.add"
|
||||
|
||||
@@ -55,6 +55,7 @@ void initializeColorRules ();
|
||||
void autoColorize (Task&, Color&);
|
||||
std::string colorizeHeader (const std::string&);
|
||||
std::string colorizeFootnote (const std::string&);
|
||||
std::string colorizeError (const std::string&);
|
||||
std::string colorizeDebug (const std::string&);
|
||||
|
||||
// dependency.cpp
|
||||
|
||||
@@ -356,6 +356,15 @@ std::string colorizeFootnote (const std::string& input)
|
||||
return input;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
std::string colorizeError (const std::string& input)
|
||||
{
|
||||
if (gsColor["color.error"].nontrivial ())
|
||||
return gsColor["color.error"].colorize (input);
|
||||
|
||||
return input;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
std::string colorizeDebug (const std::string& input)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user