Fixed #5302 (Invalid parameter for --showtime should cause an error)
This commit is contained in:
parent
f93d21c8df
commit
b411efa33f
|
@ -593,8 +593,15 @@ bool CmdLineParser::ParseFromArgs(int argc, const char* const argv[])
|
|||
_settings->_showtime = SHOWTIME_SUMMARY;
|
||||
else if (showtimeMode == "top5")
|
||||
_settings->_showtime = SHOWTIME_TOP5;
|
||||
else
|
||||
else if (showtimeMode.empty())
|
||||
_settings->_showtime = SHOWTIME_NONE;
|
||||
else {
|
||||
std::string message("cppcheck: error: unrecognized showtime mode: \"");
|
||||
message += showtimeMode;
|
||||
message += "\".";
|
||||
PrintMessage(message);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef HAVE_RULES
|
||||
|
|
Loading…
Reference in New Issue