@@ -1184,31 +1184,17 @@ CmdLineParser::Result CmdLineParser::parseFromArgs(int argc, const char* const a
1184
1184
1185
1185
mSettings .checkAllConfigurations = false ; // Can be overridden with --max-configs or --force
1186
1186
std::string projectFile = argv[i]+10 ;
1187
- projectType = project.import (projectFile, & mSettings , & mSuppressions );
1187
+ projectType = project.import (projectFile, mSettings . fileFilters );
1188
1188
if (projectType == ImportProject::Type::CPPCHECK_GUI) {
1189
- for (const std::string &lib : project.guiProject .libraries )
1190
- mSettings .libraries .emplace_back (lib);
1191
-
1192
- const auto & excludedPaths = project.guiProject .excludedPaths ;
1193
- std::copy (excludedPaths.cbegin (), excludedPaths.cend (), std::back_inserter (mIgnoredPaths ));
1194
-
1195
- std::string platform (project.guiProject .platform );
1196
-
1197
- // keep existing platform from command-line intact
1198
- if (!platform.empty ()) {
1199
- std::string errstr;
1200
- const std::vector<std::string> paths = {projectFile, argv[0 ]};
1201
- if (!mSettings .platform .set (platform, errstr, paths, mSettings .debuglookup || mSettings .debuglookupPlatform )) {
1202
- mLogger .printError (errstr);
1203
- return Result::Fail;
1204
- }
1205
- }
1189
+ if (mSettings .debugnormal && !project.guiProject .args .empty ()) // TODO: add separate debug option
1190
+ std::cout << project.guiProject .args << std::endl;
1191
+ // TODO: inject arguments
1206
1192
1207
1193
const auto & projectFileGui = project.guiProject .projectFile ;
1208
1194
if (!projectFileGui.empty ()) {
1209
1195
// read underlying project
1210
1196
projectFile = projectFileGui;
1211
- projectType = project.import (projectFileGui, & mSettings , & mSuppressions );
1197
+ projectType = project.import (projectFileGui, mSettings . fileFilters );
1212
1198
if (projectType == ImportProject::Type::CPPCHECK_GUI) {
1213
1199
mLogger .printError (" nested Cppcheck GUI projects are not supported." );
1214
1200
return Result::Fail;
@@ -1639,7 +1625,7 @@ CmdLineParser::Result CmdLineParser::parseFromArgs(int argc, const char* const a
1639
1625
}
1640
1626
1641
1627
// Print error only if we have "real" command and expect files
1642
- if (mPathNames .empty () && project.guiProject . pathNames . empty () && project. fileSettings .empty ()) {
1628
+ if (mPathNames .empty () && project.fileSettings .empty ()) {
1643
1629
// TODO: this message differs from the one reported in fillSettingsFromArgs()
1644
1630
mLogger .printError (" no C or C++ source files found." );
1645
1631
return Result::Fail;
@@ -1663,9 +1649,6 @@ CmdLineParser::Result CmdLineParser::parseFromArgs(int argc, const char* const a
1663
1649
}
1664
1650
}
1665
1651
1666
- if (!project.guiProject .pathNames .empty ())
1667
- mPathNames = project.guiProject .pathNames ;
1668
-
1669
1652
if (!project.fileSettings .empty ()) {
1670
1653
project.ignorePaths (mIgnoredPaths , mSettings .debugignore );
1671
1654
if (project.fileSettings .empty ()) {
0 commit comments