Skip to content

Commit 2c51f32

Browse files
committed
removed deprecated --showtime= value top5
1 parent 1af769e commit 2c51f32

4 files changed

Lines changed: 5 additions & 12 deletions

File tree

cli/cmdlineparser.cpp

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1412,10 +1412,6 @@ CmdLineParser::Result CmdLineParser::parseFromArgs(int argc, const char* const a
14121412
mSettings.showtime = SHOWTIME_MODES::SHOWTIME_FILE_TOTAL;
14131413
else if (showtimeMode == "summary")
14141414
mSettings.showtime = SHOWTIME_MODES::SHOWTIME_SUMMARY;
1415-
else if (showtimeMode == "top5") {
1416-
mSettings.showtime = SHOWTIME_MODES::SHOWTIME_TOP5_FILE;
1417-
mLogger.printMessage("--showtime=top5 is deprecated and will be removed in Cppcheck 2.14. Please use --showtime=top5_file or --showtime=top5_summary instead.");
1418-
}
14191415
else if (showtimeMode == "top5_file")
14201416
mSettings.showtime = SHOWTIME_MODES::SHOWTIME_TOP5_FILE;
14211417
else if (showtimeMode == "top5_summary")
@@ -1427,7 +1423,7 @@ CmdLineParser::Result CmdLineParser::parseFromArgs(int argc, const char* const a
14271423
return Result::Fail;
14281424
}
14291425
else {
1430-
mLogger.printError("unrecognized --showtime mode: '" + showtimeMode + "'. Supported modes: file, file-total, summary, top5, top5_file, top5_summary.");
1426+
mLogger.printError("unrecognized --showtime mode: '" + showtimeMode + "'. Supported modes: file, file-total, summary, top5_file, top5_summary.");
14311427
return Result::Fail;
14321428
}
14331429
}
@@ -1959,8 +1955,6 @@ void CmdLineParser::printHelp() const
19591955
" Show the top 5 for each processed file\n"
19601956
" * top5_summary\n"
19611957
" Show the top 5 summary at the end\n"
1962-
" * top5\n"
1963-
" Alias for top5_file (deprecated)\n"
19641958
" --std=<id> Set standard.\n"
19651959
" The available options are:\n"
19661960
" * 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
@@ -2018,9 +2018,8 @@ class TestCmdlineParser : public TestFixture {
20182018
void showtimeTop5() {
20192019
REDIRECT;
20202020
const char * const argv[] = {"cppcheck", "--showtime=top5", "file.cpp"};
2021-
ASSERT_EQUALS_ENUM(CmdLineParser::Result::Success, parseFromArgs(argv));
2022-
ASSERT(settings->showtime == SHOWTIME_MODES::SHOWTIME_TOP5_FILE);
2023-
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());
2021+
ASSERT_EQUALS_ENUM(CmdLineParser::Result::Fail, parseFromArgs(argv));
2022+
ASSERT_EQUALS("cppcheck: error: unrecognized --showtime mode: 'top5'. Supported modes: file, file-total, summary, top5_file, top5_summary.\n", logger->str());
20242023
}
20252024

20262025
void showtimeTop5File() {
@@ -2055,7 +2054,7 @@ class TestCmdlineParser : public TestFixture {
20552054
REDIRECT;
20562055
const char * const argv[] = {"cppcheck", "--showtime=top10", "file.cpp"};
20572056
ASSERT_EQUALS_ENUM(CmdLineParser::Result::Fail, parseFromArgs(argv));
2058-
ASSERT_EQUALS("cppcheck: error: unrecognized --showtime mode: 'top10'. Supported modes: file, file-total, summary, top5, top5_file, top5_summary.\n", logger->str());
2057+
ASSERT_EQUALS("cppcheck: error: unrecognized --showtime mode: 'top10'. Supported modes: file, file-total, summary, top5_file, top5_summary.\n", logger->str());
20592058
}
20602059

20612060
void errorlist() {

0 commit comments

Comments
 (0)