From c090367eb84229c90d9eb326a705ea5231cf1b0f Mon Sep 17 00:00:00 2001 From: Paul Beckingham Date: Tue, 17 Nov 2009 23:56:21 -0500 Subject: [PATCH] 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? --- src/command.cpp | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/src/command.cpp b/src/command.cpp index ee741f76b..eba05784a 100644 --- a/src/command.cpp +++ b/src/command.cpp @@ -551,6 +551,32 @@ int handleVersion (std::string &outs) out << std::endl; } + // Complain about colors that still use underscores. + int countDeprecatedColors = 0; + std::vector 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.