From da346ea13ea811bc7dba0a994841dc6fc9433bec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Marjam=C3=A4ki?= Date: Sun, 6 Oct 2024 17:43:23 +0200 Subject: [PATCH] fix --- cli/cmdlineparser.cpp | 4 ++++ cli/cppcheckexecutor.cpp | 6 ++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/cli/cmdlineparser.cpp b/cli/cmdlineparser.cpp index ae15175e7e5..a5f8a424ed3 100644 --- a/cli/cmdlineparser.cpp +++ b/cli/cmdlineparser.cpp @@ -1643,6 +1643,10 @@ void CmdLineParser::printHelp() const " is 2. A larger value will mean more errors can be found\n" " but also means the analysis will be slower.\n" " --output-file= Write results to file, rather than standard error.\n" + " --output-format=\n" + " Specify the output format. The available formats are:\n" + " * sarif\n" + " * xml\n" " --platform=, --platform=\n" " Specifies platform specific types and sizes. The\n" " available builtin platforms are:\n" diff --git a/cli/cppcheckexecutor.cpp b/cli/cppcheckexecutor.cpp index a984d6d4b06..82503bc4b18 100644 --- a/cli/cppcheckexecutor.cpp +++ b/cli/cppcheckexecutor.cpp @@ -145,8 +145,10 @@ namespace { std::string serialize(std::string productName) const { const auto nameAndVersion = Settings::getNameAndVersion(productName); - productName = nameAndVersion.first; - const std::string version = nameAndVersion.first.empty() ? CppCheck::version() : nameAndVersion.second; + productName = nameAndVersion.first.empty() ? "Cppcheck" : nameAndVersion.first; + std::string version = nameAndVersion.first.empty() ? CppCheck::version() : nameAndVersion.second; + if (version.find(" ") != std::string::npos) + version.erase(version.find(" "), std::string::npos); picojson::object doc; doc["version"] = picojson::value("2.1.0");