Skip to content

Commit da346ea

Browse files
committed
fix
1 parent a798d28 commit da346ea

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

cli/cmdlineparser.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1643,6 +1643,10 @@ void CmdLineParser::printHelp() const
16431643
" is 2. A larger value will mean more errors can be found\n"
16441644
" but also means the analysis will be slower.\n"
16451645
" --output-file=<file> Write results to file, rather than standard error.\n"
1646+
" --output-format=<format>\n"
1647+
" Specify the output format. The available formats are:\n"
1648+
" * sarif\n"
1649+
" * xml\n"
16461650
" --platform=<type>, --platform=<file>\n"
16471651
" Specifies platform specific types and sizes. The\n"
16481652
" available builtin platforms are:\n"

cli/cppcheckexecutor.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -145,8 +145,10 @@ namespace {
145145

146146
std::string serialize(std::string productName) const {
147147
const auto nameAndVersion = Settings::getNameAndVersion(productName);
148-
productName = nameAndVersion.first;
149-
const std::string version = nameAndVersion.first.empty() ? CppCheck::version() : nameAndVersion.second;
148+
productName = nameAndVersion.first.empty() ? "Cppcheck" : nameAndVersion.first;
149+
std::string version = nameAndVersion.first.empty() ? CppCheck::version() : nameAndVersion.second;
150+
if (version.find(" ") != std::string::npos)
151+
version.erase(version.find(" "), std::string::npos);
150152

151153
picojson::object doc;
152154
doc["version"] = picojson::value("2.1.0");

0 commit comments

Comments
 (0)