mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-07-30 22:43:24 +02:00
Enhancement - warns on deprecated color use
- If a color is specified using the deprecated 'on_red' instead of 'on red', generate a warning in the version report. The version report is becoming a report where .taskrc sanity checks occur. Is this good?
This commit is contained in:
parent
fff789a509
commit
c090367eb8
1 changed files with 26 additions and 0 deletions
|
@ -551,6 +551,32 @@ int handleVersion (std::string &outs)
|
|||
out << std::endl;
|
||||
}
|
||||
|
||||
// Complain about colors that still use underscores.
|
||||
int countDeprecatedColors = 0;
|
||||
std::vector <std::string> deprecatedColors;
|
||||
foreach (i, all)
|
||||
{
|
||||
if (i->find ("color.") != std::string::npos)
|
||||
{
|
||||
std::string value = context.config.get (*i);
|
||||
if (value.find ("_") != std::string::npos)
|
||||
{
|
||||
++countDeprecatedColors;
|
||||
deprecatedColors.push_back (*i);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (countDeprecatedColors)
|
||||
{
|
||||
out << "Your .taskrc file contains color settings that use deprecated "
|
||||
<< "underscores. Please check:"
|
||||
<< std::endl;
|
||||
|
||||
foreach (i, deprecatedColors)
|
||||
out << " " << *i << std::endl;
|
||||
}
|
||||
|
||||
// Verify installation. This is mentioned in the documentation as the way to
|
||||
// ensure everything is properly installed.
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue