From a9153dc317ff0d74b176234ca32cd3b019376aad Mon Sep 17 00:00:00 2001 From: Kimmo Varis Date: Thu, 4 Aug 2011 23:39:47 +0300 Subject: [PATCH] CLI print warning for deprecated options. We don't want to keep these deprecated options for ever. So lets print a clear warning for the users and give also specific release number when they will be removed. Users have a plenty of time to update their scripts and environments before removal. Ticket: #2515 (Print warning for deprecated command line options) --- cli/cmdlineparser.cpp | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/cli/cmdlineparser.cpp b/cli/cmdlineparser.cpp index e2ab8083e..e54b190e4 100644 --- a/cli/cmdlineparser.cpp +++ b/cli/cmdlineparser.cpp @@ -91,18 +91,23 @@ bool CmdLineParser::ParseFromArgs(int argc, const char* const argv[]) else if (strcmp(argv[i], "--debug-warnings") == 0) _settings->debugwarnings = true; - // Inconclusive checking - keep this for compatibility but don't - // handle it + // Enable all checks - will be removed in future else if (strcmp(argv[i], "-a") == 0 || strcmp(argv[i], "--all") == 0) - ; + { + PrintMessage("cppcheck: -a/--all option is deprecated and will be removed in 1.55 release."); + PrintMessage("cppcheck: please use --enable=all instead."); + } // Inconclusive checking (still in testing phase) else if (strcmp(argv[i], "--inconclusive") == 0) _settings->inconclusive = true; - // Checking coding style + // Checking coding style - will be removed in the future else if (strcmp(argv[i], "-s") == 0 || strcmp(argv[i], "--style") == 0) { + PrintMessage("cppcheck: -s/--style option is deprecated and will be removed in 1.55 release."); + PrintMessage("cppcheck: please use --enable=style instead."); + const std::string errmsg = _settings->addEnabled("style"); if (!errmsg.empty()) { @@ -464,6 +469,7 @@ bool CmdLineParser::ParseFromArgs(int argc, const char* const argv[]) else if (strcmp(argv[i], "--auto-dealloc") == 0) { ++i; + PrintMessage("cppcheck: --auto-dealloc option is deprecated and will be removed in 1.55 release."); } // print all possible error messages..