@@ -832,12 +832,22 @@ bool CmdLineParser::parseFromArgs(int argc, const char* const argv[])
832832 mSettings .showtime = SHOWTIME_MODES::SHOWTIME_FILE;
833833 else if (showtimeMode == " summary" )
834834 mSettings .showtime = SHOWTIME_MODES::SHOWTIME_SUMMARY;
835- else if (showtimeMode == " top5" )
836- mSettings .showtime = SHOWTIME_MODES::SHOWTIME_TOP5;
837- else if (showtimeMode.empty ())
835+ else if (showtimeMode == " top5" ) {
836+ mSettings .showtime = SHOWTIME_MODES::SHOWTIME_TOP5_FILE;
837+ printMessage (" --showtime=top5 is deprecated and will be removed in Cppcheck 2.13. Please use --showtime=top5_file or --showtime=top5_summary instead." );
838+ }
839+ else if (showtimeMode == " top5_file" )
840+ mSettings .showtime = SHOWTIME_MODES::SHOWTIME_TOP5_FILE;
841+ else if (showtimeMode == " top5_summary" )
842+ mSettings .showtime = SHOWTIME_MODES::SHOWTIME_TOP5_SUMMARY;
843+ else if (showtimeMode == " none" )
838844 mSettings .showtime = SHOWTIME_MODES::SHOWTIME_NONE;
845+ else if (showtimeMode.empty ()) {
846+ printError (" no mode provided for --showtime" );
847+ return false ;
848+ }
839849 else {
840- printError (" unrecognized showtime mode: \" " + showtimeMode + " \" . Supported modes: file, summary, top5. " );
850+ printError (" unrecognized -- showtime mode: ' " + showtimeMode + " ' " );
841851 return false ;
842852 }
843853 }
@@ -1307,7 +1317,20 @@ void CmdLineParser::printHelp()
13071317 " --rule-file=<file> Use given rule file. For more information, see:\n "
13081318 " http://sourceforge.net/projects/cppcheck/files/Articles/\n "
13091319#endif
1310- // TODO: document --showtime
1320+ " --showtime=<mode> Show timing information.\n "
1321+ " The available modes are:\n "
1322+ " * none\n "
1323+ " Show nothing (default)\n "
1324+ " * file\n "
1325+ " Show for each processed file\n "
1326+ " * summary\n "
1327+ " Show a summary at the end\n "
1328+ " * top5_file\n "
1329+ " Show the top 5 for each processed file\n "
1330+ " * top5_summary\n "
1331+ " Show the top 5 summary at the end\n "
1332+ " * top5\n "
1333+ " Alias for top5_file (deprecated)\n "
13111334 " --std=<id> Set standard.\n "
13121335 " The available options are:\n "
13131336 " * c89\n "
0 commit comments