From d55075fba8dcc6489becde4b860ab23b33302b04 Mon Sep 17 00:00:00 2001 From: firewave Date: Fri, 29 Sep 2023 17:32:18 +0200 Subject: [PATCH] disallow multiple `--project` options / TestCmdlineParser: added more `--project` tests --- cli/cmdlineparser.cpp | 6 ++++++ releasenotes.txt | 3 ++- test/testcmdlineparser.cpp | 35 +++++++++++++++++++++++++++++++++++ 3 files changed, 43 insertions(+), 1 deletion(-) diff --git a/cli/cmdlineparser.cpp b/cli/cmdlineparser.cpp index 0eb07362f91e..5a48969d7a21 100644 --- a/cli/cmdlineparser.cpp +++ b/cli/cmdlineparser.cpp @@ -654,6 +654,12 @@ bool CmdLineParser::parseFromArgs(int argc, const char* const argv[]) // --project else if (std::strncmp(argv[i], "--project=", 10) == 0) { + if (mSettings.project.projectType != ImportProject::Type::NONE) + { + mLogger.printError("multiple --project options are not supported."); + return false; + } + mSettings.checkAllConfigurations = false; // Can be overridden with --max-configs or --force std::string projectFile = argv[i]+10; ImportProject::Type projType = mSettings.project.import(projectFile, &mSettings); diff --git a/releasenotes.txt b/releasenotes.txt index 9967518840f3..c63696d945f7 100644 --- a/releasenotes.txt +++ b/releasenotes.txt @@ -14,4 +14,5 @@ Changed interface: Other: - Windows builds now default to the `native` platform instead of `win32A` or `win64`. Please specify it explicitly if you depedent on it. -- The undocumented and deprecated command-line options `--template