diff --git a/cli/cmdlineparser.cpp b/cli/cmdlineparser.cpp index c97ef32b3..ff5ddfd6a 100644 --- a/cli/cmdlineparser.cpp +++ b/cli/cmdlineparser.cpp @@ -562,19 +562,16 @@ bool CmdLineParser::ParseFromArgs(int argc, const char* const argv[]) } // Set maximum number of #ifdef configurations to check - else if (strncmp(argv[i], "--max-configs=", 14) == 0) - { + else if (strncmp(argv[i], "--max-configs=", 14) == 0) { _settings->_force = false; std::istringstream iss(14+argv[i]); - if (!(iss >> _settings->_maxConfigs)) - { + if (!(iss >> _settings->_maxConfigs)) { PrintMessage("cppcheck: argument to '--max-configs=' is not a number"); return false; } - if (_settings->_maxConfigs < 1) - { + if (_settings->_maxConfigs < 1) { PrintMessage("cppcheck: argument to '--max-configs=' must be greater than 0"); return false; } @@ -679,8 +676,8 @@ void CmdLineParser::PrintHelp() " --file-list= Specify the files to check in a text file. Add one\n" " filename per line. When file is -, the file list will\n" " be read from standard input.\n" - " -f, --force Force checking of all configurations in files. If used\n" - " together with --max-ifdefs=, the last option is the one\n" + " -f, --force Force checking of all configurations in files. If used\n" + " together with --max-ifdefs=, the last option is the one\n" " that is effective.\n" " -h, --help Print this help.\n" " -I Give include path. Give several -I parameters to give\n" @@ -695,7 +692,7 @@ void CmdLineParser::PrintHelp() " on the lines before the warning to suppress.\n" " -j Start [jobs] threads to do the checking simultaneously.\n" " --max-configs=\n" - " Maximum number of configurations to check in a file\n" + " Maximum number of configurations to check in a file\n" " before skipping it. Default is 12. If used together\n" " with --force, the last option is the one that is\n" " effective.\n" diff --git a/lib/settings.h b/lib/settings.h index f33c6801f..f98553f5c 100644 --- a/lib/settings.h +++ b/lib/settings.h @@ -121,7 +121,7 @@ public: /** @brief get append code (--append) */ std::string append() const; - /** @brief Maximum number of configurations to check before bailing. + /** @brief Maximum number of configurations to check before bailing. Default is 12. (--max-configs=N) */ int _maxConfigs; diff --git a/test/testcmdlineparser.cpp b/test/testcmdlineparser.cpp index 45df69fda..70906b33c 100644 --- a/test/testcmdlineparser.cpp +++ b/test/testcmdlineparser.cpp @@ -548,7 +548,7 @@ private: CmdLineParser parser(&settings); ASSERT(parser.ParseFromArgs(4, argv)); ASSERT_EQUALS(12, settings._maxConfigs); - ASSERT_EQUALS(false, settings._force); + ASSERT_EQUALS(false, settings._force); } void maxConfigsMissingCount() { @@ -576,7 +576,7 @@ private: CmdLineParser parser(&settings); // Fails since limit must be greater than 0 ASSERT_EQUALS(false, parser.ParseFromArgs(3, argv)); - } + } void reportProgressTest() { REDIRECT;