@@ -1139,32 +1139,23 @@ CmdLineParser::Result CmdLineParser::parseFromArgs(int argc, const char* const a
1139
1139
1140
1140
mSettings .checkAllConfigurations = false ; // Can be overridden with --max-configs or --force
1141
1141
std::string projectFile = argv[i]+10 ;
1142
- ImportProject::Type projType = project.import (projectFile, & mSettings );
1142
+ ImportProject::Type projType = project.import (projectFile, mSettings . fileFilters );
1143
1143
project.projectType = projType;
1144
1144
if (projType == ImportProject::Type::CPPCHECK_GUI) {
1145
- for (const std::string &lib : project.guiProject .libraries )
1146
- mSettings .libraries .emplace_back (lib);
1147
-
1148
- const auto & excludedPaths = project.guiProject .excludedPaths ;
1149
- std::copy (excludedPaths.cbegin (), excludedPaths.cend (), std::back_inserter (mIgnoredPaths ));
1150
-
1151
- std::string platform (project.guiProject .platform );
1152
-
1153
- // keep existing platform from command-line intact
1154
- if (!platform.empty ()) {
1155
- std::string errstr;
1156
- const std::vector<std::string> paths = {projectFile, argv[0 ]};
1157
- if (!mSettings .platform .set (platform, errstr, paths, mSettings .debuglookup || mSettings .debuglookupPlatform )) {
1158
- mLogger .printError (errstr);
1159
- return Result::Fail;
1160
- }
1161
- }
1162
-
1145
+ if (mSettings .debugnormal && !project.guiProject .args .empty ()) // TODO: add separate debug option
1146
+ std::cout << project.guiProject .args << std::endl;
1147
+ // TODO: inject arguments
1163
1148
const auto & projectFileGui = project.guiProject .projectFile ;
1164
1149
if (!projectFileGui.empty ()) {
1165
1150
// read underlying project
1166
1151
projectFile = projectFileGui;
1167
- projType = project.import (projectFileGui, &mSettings );
1152
+ projType = project.import (projectFileGui, mSettings .fileFilters );
1153
+ if (projType == ImportProject::Type::CPPCHECK_GUI) {
1154
+ if (mSettings .debugnormal && !project.guiProject .args .empty ()) // TODO: add separate debug option
1155
+ std::cout << project.guiProject .args << std::endl;
1156
+ // TODO: inject arguments
1157
+ // TODO: inception
1158
+ }
1168
1159
}
1169
1160
}
1170
1161
if (projType == ImportProject::Type::VS_SLN || projType == ImportProject::Type::VS_VCXPROJ) {
@@ -1577,15 +1568,12 @@ CmdLineParser::Result CmdLineParser::parseFromArgs(int argc, const char* const a
1577
1568
}
1578
1569
1579
1570
// Print error only if we have "real" command and expect files
1580
- if (mPathNames .empty () && project.guiProject . pathNames . empty () && project. fileSettings .empty ()) {
1571
+ if (mPathNames .empty () && project.fileSettings .empty ()) {
1581
1572
// TODO: this message differs from the one reported in fillSettingsFromArgs()
1582
1573
mLogger .printError (" no C or C++ source files found." );
1583
1574
return Result::Fail;
1584
1575
}
1585
1576
1586
- if (!project.guiProject .pathNames .empty ())
1587
- mPathNames = project.guiProject .pathNames ;
1588
-
1589
1577
if (!project.fileSettings .empty ()) {
1590
1578
project.ignorePaths (mIgnoredPaths );
1591
1579
if (project.fileSettings .empty ()) {
0 commit comments