diff --git a/Engine/CLArgs.cpp b/Engine/CLArgs.cpp index 459e9903cb..9af9eea3c0 100644 --- a/Engine/CLArgs.cpp +++ b/Engine/CLArgs.cpp @@ -766,6 +766,12 @@ tryParseMultipleFrameRanges(const QString& args, void CLArgsPrivate::parse() { +#ifdef DEBUG + qDebug() << "args:"; + for (QStringList::iterator it = args.begin(); it != args.end(); ++it) { + qDebug() << *it; + } +#endif { QStringList::iterator it = hasToken( QString::fromUtf8("version"), QString::fromUtf8("v") ); if ( it != args.end() ) { @@ -1223,13 +1229,14 @@ CLArgsPrivate::parse() QStringList::iterator it = findFileNameWithExtension( QString::fromUtf8(NATRON_PROJECT_FILE_EXT) ); if ( it == args.end() ) { it = findFileNameWithExtension( QString::fromUtf8("py") ); - if ( ( it == args.end() ) && !isInterpreterMode && isBackground ) { - std::cout << tr("You must specify the filename of a script (.py) or a %1 project. (.%2)").arg( QString::fromUtf8(NATRON_APPLICATION_NAME) ).arg( QString::fromUtf8(NATRON_PROJECT_FILE_EXT) ).toStdString() << std::endl; + if (it != args.end()) { + isPythonScript = true; + } else if (!isInterpreterMode && isBackground) { + std::cout << tr("You must specify the filename of a script or %1 project. (.%2)").arg( QString::fromUtf8(NATRON_APPLICATION_NAME) ).arg( QString::fromUtf8(NATRON_PROJECT_FILE_EXT) ).toStdString() << std::endl; error = 1; return; } - isPythonScript = true; } if ( it != args.end() ) { filename = *it; @@ -1295,6 +1302,12 @@ CLArgsPrivate::parse() for (auto&& it: frameRanges) { qDebug() << it.first << it.second.first << it.second.second; } + if ( !args.empty() ) { + qDebug() << "Remaining args:"; + for (QStringList::iterator it = args.begin(); it != args.end(); ++it) { + qDebug() << *it; + } + } qDebug() << "* End of command-line parsing results."; #endif // DEBUG diff --git a/Tests/wmain.cpp b/Tests/wmain.cpp index 2a6d1021a7..2c9a2f2872 100755 --- a/Tests/wmain.cpp +++ b/Tests/wmain.cpp @@ -20,10 +20,10 @@ GTEST_API_ int main(int argc, char **argv) { int argc = 0; QStringList args; + args << QString::fromUtf8(argv[0]); args << QString::fromUtf8("--clear-cache"); args << QString::fromUtf8("--clear-openfx-cache"); args << QString::fromUtf8("--no-settings"); - args << QString::fromUtf8("dummy.ntp"); CLArgs cl(args, true); if (!manager.load(argc, 0, cl)) { printf("Failed to load AppManager\n");