Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions cli/cmdlineparser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,7 @@ CmdLineParser::Result CmdLineParser::parseFromArgs(int argc, const char* const a
return Result::Fail;

if (argc <= 1) {
printHelp(mSettings.premium);
printHelp();
return Result::Exit;
}

Expand Down Expand Up @@ -388,7 +388,7 @@ CmdLineParser::Result CmdLineParser::parseFromArgs(int argc, const char* const a

// Print help
if (std::strcmp(argv[i], "-h") == 0 || std::strcmp(argv[i], "--help") == 0) {
printHelp(mSettings.premium);
printHelp();
return Result::Exit;
}

Expand Down Expand Up @@ -1700,7 +1700,7 @@ CmdLineParser::Result CmdLineParser::parseFromArgs(int argc, const char* const a
return Result::Success;
}

void CmdLineParser::printHelp(bool premium) const
void CmdLineParser::printHelp() const
{
std::ostringstream oss;
// TODO: display product name
Expand Down Expand Up @@ -1901,7 +1901,7 @@ void CmdLineParser::printHelp(bool premium) const
" --plist-output=<path>\n"
" Generate Clang-plist output files in folder.\n";

if (premium) {
if (mSettings.premium) {
oss <<
" --premium=<option>\n"
" Coding standards:\n"
Expand Down
2 changes: 1 addition & 1 deletion cli/cmdlineparser.h
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ class CmdLineParser {
/**
* Print help text to the console.
*/
void printHelp(bool premium) const;
void printHelp() const;

template<typename T>
bool parseNumberArg(const char* const arg, std::size_t offset, T& num, bool mustBePositive = false)
Expand Down
6 changes: 1 addition & 5 deletions lib/checkersreport.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,6 @@
#include <unordered_set>
#include <vector>

static bool isCppcheckPremium(const Settings& settings) {
return (settings.cppcheckCfgProductName.compare(0, 16, "Cppcheck Premium") == 0);
}

static int getMisraCVersion(const Settings& settings) {
if (settings.premiumArgs.find("misra-c-2025") != std::string::npos)
return 2025;
Expand Down Expand Up @@ -194,7 +190,7 @@ std::string CheckersReport::getReport(const std::string& criticalErrors) const
fout << std::endl;
}

const bool cppcheckPremium = isCppcheckPremium(mSettings);
const bool cppcheckPremium = mSettings.premium;

auto reportSection = [&fout, cppcheckPremium]
(const std::string& title,
Expand Down
Loading