mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-02-09 04:59:56 -06:00
Add a commandline argument to override the cache directory
This commit is contained in:
@@ -112,6 +112,7 @@ namespace {
|
||||
std::string configurationName;
|
||||
std::string sgctConfigurationName;
|
||||
std::string sceneName;
|
||||
std::string cacheFolder;
|
||||
} commandlineArgumentPlaceholders;
|
||||
}
|
||||
|
||||
@@ -283,6 +284,14 @@ bool OpenSpaceEngine::create(int argc, char** argv,
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!commandlineArgumentPlaceholders.cacheFolder.empty()) {
|
||||
FileSys.registerPathToken(
|
||||
"${CACHE}",
|
||||
commandlineArgumentPlaceholders.cacheFolder,
|
||||
ghoul::filesystem::FileSystem::Override::Yes
|
||||
);
|
||||
}
|
||||
|
||||
// Initialize the requested logs from the configuration file
|
||||
_engine->configureLogging();
|
||||
|
||||
@@ -599,6 +608,14 @@ bool OpenSpaceEngine::gatherCommandlineArguments() {
|
||||
"the scene file, overriding the value set in the OpenSpace configuration file"
|
||||
));
|
||||
|
||||
commandlineArgumentPlaceholders.cacheFolder = "";
|
||||
_commandlineParser->addCommand(std::make_unique<SingleCommand<std::string>>(
|
||||
&commandlineArgumentPlaceholders.cacheFolder, "-cacheDir", "", "Provides the "
|
||||
"path to a cache file, overriding the value set in the OpenSpace configuration "
|
||||
"file"
|
||||
));
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user