Skip to content

Commit 1968e84

Browse files
authored
fixed #13135 - removed deprecated --showtime= value top5 (danmar#5907)
1 parent 719f2e3 commit 1968e84

File tree

4 files changed

+5
-12
lines changed

4 files changed

+5
-12
lines changed

cli/cmdlineparser.cpp

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1397,10 +1397,6 @@ CmdLineParser::Result CmdLineParser::parseFromArgs(int argc, const char* const a
13971397
mSettings.showtime = SHOWTIME_MODES::SHOWTIME_FILE_TOTAL;
13981398
else if (showtimeMode == "summary")
13991399
mSettings.showtime = SHOWTIME_MODES::SHOWTIME_SUMMARY;
1400-
else if (showtimeMode == "top5") {
1401-
mSettings.showtime = SHOWTIME_MODES::SHOWTIME_TOP5_FILE;
1402-
mLogger.printMessage("--showtime=top5 is deprecated and will be removed in Cppcheck 2.14. Please use --showtime=top5_file or --showtime=top5_summary instead.");
1403-
}
14041400
else if (showtimeMode == "top5_file")
14051401
mSettings.showtime = SHOWTIME_MODES::SHOWTIME_TOP5_FILE;
14061402
else if (showtimeMode == "top5_summary")
@@ -1412,7 +1408,7 @@ CmdLineParser::Result CmdLineParser::parseFromArgs(int argc, const char* const a
14121408
return Result::Fail;
14131409
}
14141410
else {
1415-
mLogger.printError("unrecognized --showtime mode: '" + showtimeMode + "'. Supported modes: file, file-total, summary, top5, top5_file, top5_summary.");
1411+
mLogger.printError("unrecognized --showtime mode: '" + showtimeMode + "'. Supported modes: file, file-total, summary, top5_file, top5_summary.");
14161412
return Result::Fail;
14171413
}
14181414
}
@@ -1968,8 +1964,6 @@ void CmdLineParser::printHelp() const
19681964
" Show the top 5 for each processed file\n"
19691965
" * top5_summary\n"
19701966
" Show the top 5 summary at the end\n"
1971-
" * top5\n"
1972-
" Alias for top5_file (deprecated)\n"
19731967
" --std=<id> Set standard.\n"
19741968
" The available options are:\n"
19751969
" * c89\n"

man/cppcheck.1.xml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -630,7 +630,6 @@ There are false positives with this option. Each result must be carefully invest
630630
<glossentry><glossterm>summary</glossterm><glossdef><para>Show a summary at the end</para></glossdef></glossentry>
631631
<glossentry><glossterm>top5_file</glossterm><glossdef><para>Show the top 5 for each processed file</para></glossdef></glossentry>
632632
<glossentry><glossterm>top5_summary</glossterm><glossdef><para>Show the top 5 summary at the end</para></glossdef></glossentry>
633-
<glossentry><glossterm>top5</glossterm><glossdef><para>Alias for top5_file (deprecated)</para></glossdef></glossentry>
634633
</glosslist>
635634
</para>
636635
</listitem>

releasenotes.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,5 @@ Other:
2828
- Fix checking a project that contains several project file entries for the same file.
2929
- Fixed --file-filter matching of looked up files in provided paths.
3030
- Split up cstyleCast checker; dangerous casts produce portability/warning reports, safe casts produce style reports.
31+
- Removed deprecated '--showtime=' value 'top5'. Please use 'top5_file' or 'top5_summary' instead.
3132
-

test/testcmdlineparser.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2026,9 +2026,8 @@ class TestCmdlineParser : public TestFixture {
20262026
void showtimeTop5() {
20272027
REDIRECT;
20282028
const char * const argv[] = {"cppcheck", "--showtime=top5", "file.cpp"};
2029-
ASSERT_EQUALS_ENUM(CmdLineParser::Result::Success, parseFromArgs(argv));
2030-
ASSERT(settings->showtime == SHOWTIME_MODES::SHOWTIME_TOP5_FILE);
2031-
ASSERT_EQUALS("cppcheck: --showtime=top5 is deprecated and will be removed in Cppcheck 2.14. Please use --showtime=top5_file or --showtime=top5_summary instead.\n", logger->str());
2029+
ASSERT_EQUALS_ENUM(CmdLineParser::Result::Fail, parseFromArgs(argv));
2030+
ASSERT_EQUALS("cppcheck: error: unrecognized --showtime mode: 'top5'. Supported modes: file, file-total, summary, top5_file, top5_summary.\n", logger->str());
20322031
}
20332032

20342033
void showtimeTop5File() {
@@ -2063,7 +2062,7 @@ class TestCmdlineParser : public TestFixture {
20632062
REDIRECT;
20642063
const char * const argv[] = {"cppcheck", "--showtime=top10", "file.cpp"};
20652064
ASSERT_EQUALS_ENUM(CmdLineParser::Result::Fail, parseFromArgs(argv));
2066-
ASSERT_EQUALS("cppcheck: error: unrecognized --showtime mode: 'top10'. Supported modes: file, file-total, summary, top5, top5_file, top5_summary.\n", logger->str());
2065+
ASSERT_EQUALS("cppcheck: error: unrecognized --showtime mode: 'top10'. Supported modes: file, file-total, summary, top5_file, top5_summary.\n", logger->str());
20672066
}
20682067

20692068
void errorlist() {

0 commit comments

Comments
 (0)