@@ -821,12 +821,22 @@ bool CmdLineParser::parseFromArgs(int argc, const char* const argv[])
821821 mSettings .showtime = SHOWTIME_MODES::SHOWTIME_FILE_TOTAL;
822822 else if (showtimeMode == " summary" )
823823 mSettings .showtime = SHOWTIME_MODES::SHOWTIME_SUMMARY;
824- else if (showtimeMode == " top5" )
825- mSettings .showtime = SHOWTIME_MODES::SHOWTIME_TOP5;
826- else if (showtimeMode.empty ())
824+ else if (showtimeMode == " top5" ) {
825+ mSettings .showtime = SHOWTIME_MODES::SHOWTIME_TOP5_FILE;
826+ printMessage (" --showtime=top5 is deprecated and will be removed in Cppcheck 2.13. Please use --showtime=top5_file or --showtime=top5_summary instead." );
827+ }
828+ else if (showtimeMode == " top5_file" )
829+ mSettings .showtime = SHOWTIME_MODES::SHOWTIME_TOP5_FILE;
830+ else if (showtimeMode == " top5_summary" )
831+ mSettings .showtime = SHOWTIME_MODES::SHOWTIME_TOP5_SUMMARY;
832+ else if (showtimeMode == " none" )
827833 mSettings .showtime = SHOWTIME_MODES::SHOWTIME_NONE;
834+ else if (showtimeMode.empty ()) {
835+ printError (" no mode provided for --showtime" );
836+ return false ;
837+ }
828838 else {
829- printError (" unrecognized showtime mode: \" " + showtimeMode + " \" . Supported modes: file, file-total, summary, top5." );
839+ printError (" unrecognized -- showtime mode: \" " + showtimeMode + " \" . Supported modes: file, file-total, summary, top5." );
830840 return false ;
831841 }
832842 }
@@ -1296,7 +1306,20 @@ void CmdLineParser::printHelp()
12961306 " --rule-file=<file> Use given rule file. For more information, see:\n "
12971307 " http://sourceforge.net/projects/cppcheck/files/Articles/\n "
12981308#endif
1299- // TODO: document --showtime
1309+ " --showtime=<mode> Show timing information.\n "
1310+ " The available modes are:\n "
1311+ " * none\n "
1312+ " Show nothing (default)\n "
1313+ " * file\n "
1314+ " Show for each processed file\n "
1315+ " * summary\n "
1316+ " Show a summary at the end\n "
1317+ " * top5_file\n "
1318+ " Show the top 5 for each processed file\n "
1319+ " * top5_summary\n "
1320+ " Show the top 5 summary at the end\n "
1321+ " * top5\n "
1322+ " Alias for top5_file (deprecated)\n "
13001323 " --std=<id> Set standard.\n "
13011324 " The available options are:\n "
13021325 " * c89\n "
0 commit comments