Skip to content
Draft
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
7 changes: 1 addition & 6 deletions cli/cmdlineparser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1703,11 +1703,6 @@ CmdLineParser::Result CmdLineParser::parseFromArgs(int argc, const char* const a

void CmdLineParser::printHelp(bool premium) const
{
// TODO: fetch URL from config like product name?
const std::string manualUrl(premium ?
"https://files.cppchecksolutions.com/manual.pdf" :
"https://cppcheck.sourceforge.io/manual.pdf");

std::ostringstream oss;
// TODO: display product name
oss << "Cppcheck - A tool for static C/C++ code analysis\n"
Expand Down Expand Up @@ -2078,7 +2073,7 @@ void CmdLineParser::printHelp(bool premium) const
" cppcheck -I inc1/ -I inc2/ f.cpp\n"
"\n"
"For more information:\n"
" " << manualUrl << "\n"
" " << mSettings.manualUrl << "\n"
"\n"
"Many thanks to the 3rd party libraries we use:\n"
" * tinyxml2 -- loading project/library/ctu files.\n"
Expand Down
9 changes: 9 additions & 0 deletions lib/settings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,15 @@ std::string Settings::loadCppcheckCfg(Settings& settings, Suppressions& suppress
settings.cppcheckCfgProductName = v.get<std::string>();
}
}
{
const auto it = utils::as_const(obj).find("manualUrl");
if (it != obj.cend()) {
const auto& v = it->second;
if (!v.is<std::string>())
return "'manualUrl' is not a string";
settings.manualUrl = v.get<std::string>();
}
}
{
const auto it = utils::as_const(obj).find("about");
if (it != obj.cend()) {
Expand Down
2 changes: 2 additions & 0 deletions lib/settings.h
Original file line number Diff line number Diff line change
Expand Up @@ -291,6 +291,8 @@ class CPPCHECKLIB WARN_UNUSED Settings {
int loadAverage{};
#endif

std::string manualUrl{"https://cppcheck.sourceforge.io/manual.pdf"};

/** --max-configs value */
int maxConfigsOption = 0; // "Not Assigned" value

Expand Down