astyle formatting
This commit is contained in:
parent
8157799e10
commit
a9d2d45fbc
@ -562,19 +562,16 @@ bool CmdLineParser::ParseFromArgs(int argc, const char* const argv[])
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Set maximum number of #ifdef configurations to check
|
// 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;
|
_settings->_force = false;
|
||||||
|
|
||||||
std::istringstream iss(14+argv[i]);
|
std::istringstream iss(14+argv[i]);
|
||||||
if (!(iss >> _settings->_maxConfigs))
|
if (!(iss >> _settings->_maxConfigs)) {
|
||||||
{
|
|
||||||
PrintMessage("cppcheck: argument to '--max-configs=' is not a number");
|
PrintMessage("cppcheck: argument to '--max-configs=' is not a number");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_settings->_maxConfigs < 1)
|
if (_settings->_maxConfigs < 1) {
|
||||||
{
|
|
||||||
PrintMessage("cppcheck: argument to '--max-configs=' must be greater than 0");
|
PrintMessage("cppcheck: argument to '--max-configs=' must be greater than 0");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -679,8 +676,8 @@ void CmdLineParser::PrintHelp()
|
|||||||
" --file-list=<file> Specify the files to check in a text file. Add one\n"
|
" --file-list=<file> Specify the files to check in a text file. Add one\n"
|
||||||
" filename per line. When file is -, the file list will\n"
|
" filename per line. When file is -, the file list will\n"
|
||||||
" be read from standard input.\n"
|
" be read from standard input.\n"
|
||||||
" -f, --force Force checking of all configurations in files. If used\n"
|
" -f, --force Force checking of all configurations in files. If used\n"
|
||||||
" together with --max-ifdefs=, the last option is the one\n"
|
" together with --max-ifdefs=, the last option is the one\n"
|
||||||
" that is effective.\n"
|
" that is effective.\n"
|
||||||
" -h, --help Print this help.\n"
|
" -h, --help Print this help.\n"
|
||||||
" -I <dir> Give include path. Give several -I parameters to give\n"
|
" -I <dir> 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"
|
" on the lines before the warning to suppress.\n"
|
||||||
" -j <jobs> Start [jobs] threads to do the checking simultaneously.\n"
|
" -j <jobs> Start [jobs] threads to do the checking simultaneously.\n"
|
||||||
" --max-configs=<limit>\n"
|
" --max-configs=<limit>\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"
|
" before skipping it. Default is 12. If used together\n"
|
||||||
" with --force, the last option is the one that is\n"
|
" with --force, the last option is the one that is\n"
|
||||||
" effective.\n"
|
" effective.\n"
|
||||||
|
@ -121,7 +121,7 @@ public:
|
|||||||
/** @brief get append code (--append) */
|
/** @brief get append code (--append) */
|
||||||
std::string append() const;
|
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) */
|
Default is 12. (--max-configs=N) */
|
||||||
int _maxConfigs;
|
int _maxConfigs;
|
||||||
|
|
||||||
|
@ -548,7 +548,7 @@ private:
|
|||||||
CmdLineParser parser(&settings);
|
CmdLineParser parser(&settings);
|
||||||
ASSERT(parser.ParseFromArgs(4, argv));
|
ASSERT(parser.ParseFromArgs(4, argv));
|
||||||
ASSERT_EQUALS(12, settings._maxConfigs);
|
ASSERT_EQUALS(12, settings._maxConfigs);
|
||||||
ASSERT_EQUALS(false, settings._force);
|
ASSERT_EQUALS(false, settings._force);
|
||||||
}
|
}
|
||||||
|
|
||||||
void maxConfigsMissingCount() {
|
void maxConfigsMissingCount() {
|
||||||
@ -576,7 +576,7 @@ private:
|
|||||||
CmdLineParser parser(&settings);
|
CmdLineParser parser(&settings);
|
||||||
// Fails since limit must be greater than 0
|
// Fails since limit must be greater than 0
|
||||||
ASSERT_EQUALS(false, parser.ParseFromArgs(3, argv));
|
ASSERT_EQUALS(false, parser.ParseFromArgs(3, argv));
|
||||||
}
|
}
|
||||||
|
|
||||||
void reportProgressTest() {
|
void reportProgressTest() {
|
||||||
REDIRECT;
|
REDIRECT;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user