@@ -829,12 +829,22 @@ bool CmdLineParser::parseFromArgs(int argc, const char* const argv[])
829829 mSettings .showtime = SHOWTIME_MODES::SHOWTIME_FILE;
830830 else if (showtimeMode == " summary" )
831831 mSettings .showtime = SHOWTIME_MODES::SHOWTIME_SUMMARY;
832- else if (showtimeMode == " top5" )
833- mSettings .showtime = SHOWTIME_MODES::SHOWTIME_TOP5;
834- else if (showtimeMode.empty ())
832+ else if (showtimeMode == " top5" ) {
833+ mSettings .showtime = SHOWTIME_MODES::SHOWTIME_TOP5_FILE;
834+ printMessage (" --showtime=top5 is deprecated and will be removed in Cppcheck 2.13. Please use --showtime=top5_file or --showtime=top5_summary instead." );
835+ }
836+ else if (showtimeMode == " top5_file" )
837+ mSettings .showtime = SHOWTIME_MODES::SHOWTIME_TOP5_FILE;
838+ else if (showtimeMode == " top5_summary" )
839+ mSettings .showtime = SHOWTIME_MODES::SHOWTIME_TOP5_SUMMARY;
840+ else if (showtimeMode == " none" )
835841 mSettings .showtime = SHOWTIME_MODES::SHOWTIME_NONE;
842+ else if (showtimeMode.empty ()) {
843+ printError (" no mode provided for --showtime" );
844+ return false ;
845+ }
836846 else {
837- printError (" unrecognized showtime mode: \" " + showtimeMode + " \" . Supported modes: file, summary, top5. " );
847+ printError (" unrecognized -- showtime mode: ' " + showtimeMode + " ' " );
838848 return false ;
839849 }
840850 }
@@ -1304,7 +1314,20 @@ void CmdLineParser::printHelp()
13041314 " --rule-file=<file> Use given rule file. For more information, see:\n "
13051315 " http://sourceforge.net/projects/cppcheck/files/Articles/\n "
13061316#endif
1307- // TODO: document --showtime
1317+ " --showtime=<mode> Show timing information.\n "
1318+ " The available modes are:\n "
1319+ " * none\n "
1320+ " Show nothing (default)\n "
1321+ " * file\n "
1322+ " Show for each processed file\n "
1323+ " * summary\n "
1324+ " Show a summary at the end\n "
1325+ " * top5_file\n "
1326+ " Show the top 5 for each processed file\n "
1327+ " * top5_summary\n "
1328+ " Show the top 5 summary at the end\n "
1329+ " * top5\n "
1330+ " Alias for top5_file (deprecated)\n "
13081331 " --std=<id> Set standard.\n "
13091332 " The available options are:\n "
13101333 " * c89\n "
0 commit comments