From f1e2765da943b238bbef2d582dc0842979214c2f Mon Sep 17 00:00:00 2001 From: Alexander Bock Date: Thu, 26 Jan 2023 21:08:37 +0100 Subject: [PATCH] Add support for multiple occurrances of -c commandline argument --- apps/OpenSpace/main.cpp | 9 +++++++-- include/openspace/engine/openspaceengine.h | 2 +- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/apps/OpenSpace/main.cpp b/apps/OpenSpace/main.cpp index cd3c7d166d..d012932ca5 100644 --- a/apps/OpenSpace/main.cpp +++ b/apps/OpenSpace/main.cpp @@ -33,6 +33,7 @@ #include #include #include +#include #include #include #include @@ -1108,7 +1109,7 @@ int main(int argc, char* argv[]) { "current working directory" )); - parser.addCommand(std::make_unique>( + parser.addCommand(std::make_unique>( commandlineArguments.configurationOverride, "--config", "-c", "Provides the ability to pass arbitrary Lua code to the application that will be " "evaluated after the configuration file has been loaded but before the other " @@ -1181,10 +1182,14 @@ int main(int argc, char* argv[]) { // Loading configuration from disk LDEBUG("Loading configuration from disk"); + std::string override; + for (const std::string& arg : commandlineArguments.configurationOverride) { + override += arg + ";"; + } *global::configuration = configuration::loadConfigurationFromFile( configurationFilePath.string(), size, - commandlineArguments.configurationOverride + override ); // Determining SGCT configuration file diff --git a/include/openspace/engine/openspaceengine.h b/include/openspace/engine/openspaceengine.h index 5a9a1b0033..74a0607bb5 100644 --- a/include/openspace/engine/openspaceengine.h +++ b/include/openspace/engine/openspaceengine.h @@ -64,7 +64,7 @@ struct ShutdownInformation { struct CommandlineArguments { std::string configurationName; - std::string configurationOverride; + std::vector configurationOverride; }; class OpenSpaceEngine : public properties::PropertyOwner {