Add support for multiple occurrances of -c commandline argument

This commit is contained in:
Alexander Bock
2023-01-26 21:08:37 +01:00
parent a49bf5d3ce
commit f1e2765da9
2 changed files with 8 additions and 3 deletions

View File

@@ -33,6 +33,7 @@
#include <ghoul/fmt.h>
#include <ghoul/glm.h>
#include <ghoul/cmdparser/commandlineparser.h>
#include <ghoul/cmdparser/multiplecommand.h>
#include <ghoul/cmdparser/singlecommand.h>
#include <ghoul/filesystem/filesystem.h>
#include <ghoul/logging/visualstudiooutputlog.h>
@@ -1108,7 +1109,7 @@ int main(int argc, char* argv[]) {
"current working directory"
));
parser.addCommand(std::make_unique<ghoul::cmdparser::SingleCommand<std::string>>(
parser.addCommand(std::make_unique<ghoul::cmdparser::MultipleCommand<std::string>>(
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

View File

@@ -64,7 +64,7 @@ struct ShutdownInformation {
struct CommandlineArguments {
std::string configurationName;
std::string configurationOverride;
std::vector<std::string> configurationOverride;
};
class OpenSpaceEngine : public properties::PropertyOwner {