diff --git a/src/commands/CmdShow.cpp b/src/commands/CmdShow.cpp index 2b5fe3245..ee66461e3 100644 --- a/src/commands/CmdShow.cpp +++ b/src/commands/CmdShow.cpp @@ -284,6 +284,16 @@ int CmdShow::execute (std::string& output) << (view.rows () == 0 ? STRING_CMD_SHOW_NONE : "") << (view.rows () == 0 ? "\n\n" : "\n"); + if (default_values.size ()) + { + out << STRING_CMD_SHOW_DIFFER; + + if (context.color ()) + out << " " + << format (STRING_CMD_SHOW_DIFFER_COLOR, warning.colorize ("color")) + << "\n\n"; + } + // Display the unrecognized variables. if (unrecognized.size ()) { @@ -298,14 +308,7 @@ int CmdShow::execute (std::string& output) out << "\n\n"; } - if (default_values.size ()) - { - out << STRING_CMD_SHOW_DIFFER; - - if (context.color ()) - out << " " << format (STRING_CMD_SHOW_DIFFER_COLOR, warning.colorize ("color")); - } - + out << legacyCheckForDeprecatedVariables (); out << legacyCheckForDeprecatedColor (); out << legacyCheckForDeprecatedColumns (); diff --git a/src/en-US.h b/src/en-US.h index 679bce0fc..27cf44a81 100644 --- a/src/en-US.h +++ b/src/en-US.h @@ -495,6 +495,7 @@ #define STRING_CONFIG_BAD_WRITE "Could not write to '{1}'." #define STRING_CONFIG_DEPRECATED_US "Your .taskrc file contains color settings that use deprecated underscores. Please check:" #define STRING_CONFIG_DEPRECATED_COL "Your .taskrc file contains reports with deprecated columns. Please check for entry_time, start_time or end_time in:" +#define STRING_CONFIG_DEPRECATED_VAR "Your .taskrc file contains variables that are deprecated:" // Context #define STRING_CONTEXT_CREATE_RC "A configuration file could not be found in {1}\n\nWould you like a sample {2} created, so taskwarrior can proceed?" diff --git a/src/legacy.cpp b/src/legacy.cpp index 2f16b8388..857cdba65 100644 --- a/src/legacy.cpp +++ b/src/legacy.cpp @@ -134,6 +134,39 @@ std::string legacyCheckForDeprecatedColor () return out.str (); } +//////////////////////////////////////////////////////////////////////////////// +std::string legacyCheckForDeprecatedVariables () +{ + std::vector deprecated; + std::map ::const_iterator it; + for (it = context.config.begin (); it != context.config.end (); ++it) + { + // report.*.limit + if (it->first.substr (0, 7) == "report." && + it->first.substr (it->first.length () - 6) == ".limit") + deprecated.push_back (it->first); + + if (it->first == "echo.command" || + it->first == "edit.verbose") + deprecated.push_back (it->first); + } + + std::stringstream out; + if (deprecated.size ()) + { + out << STRING_CONFIG_DEPRECATED_VAR + << "\n"; + + std::vector ::iterator it2; + for (it2 = deprecated.begin (); it2 != deprecated.end (); ++it2) + out << " " << *it2 << "\n"; + + out << "\n"; + } + + return out.str (); +} + //////////////////////////////////////////////////////////////////////////////// std::string legacyCheckForDeprecatedColumns () { diff --git a/src/main.h b/src/main.h index 40bdb5b94..607e6f726 100644 --- a/src/main.h +++ b/src/main.h @@ -86,6 +86,7 @@ void legacyAttributeCheck (const std::string&); void legacyColumnMap (std::string&); void legacySortColumnMap (std::string&); std::string legacyCheckForDeprecatedColor (); +std::string legacyCheckForDeprecatedVariables (); std::string legacyCheckForDeprecatedColumns (); // list template