diff --git a/docs/general/command_line_flags.md b/docs/general/command_line_flags.md index 40c28a5c..a57a55db 100644 --- a/docs/general/command_line_flags.md +++ b/docs/general/command_line_flags.md @@ -20,6 +20,17 @@ Sets the log level of the engine to either `DEBUG`, `WARN` ,`INFO`, `ERROR`. Overrides the default path `project.scfg` with the value that's passed in. +## Starting Directory + +`-sd` `-starting-directory` + +``` +[SEIKA_ENGINE] [PROJECT_FILE_FLAG] [ENGINE_EXECUTABLE_DIRECTORY] +``` + +Overrides the default directory of the engine on startup. Mostly to be used by the editor. + + ## Working Directory `-d` `-working-directory` diff --git a/src/core/utils/command_line_flag_helper.h b/src/core/utils/command_line_flag_helper.h index 4df390f9..f129745b 100644 --- a/src/core/utils/command_line_flag_helper.h +++ b/src/core/utils/command_line_flag_helper.h @@ -19,6 +19,8 @@ class CommandLineFlagHelper { const std::string FLAG_SET_LOG_LEVEL1 = "-log-level"; const std::string FLAG_SET_PROJECT_FILE_PATH0 = "-p"; const std::string FLAG_SET_PROJECT_FILE_PATH1 = "-project-file"; + const std::string FLAG_SET_PROJECT_STARTING_DIRECTORY0 = "-sd"; + const std::string FLAG_SET_PROJECT_STARTING_DIRECTORY1 = "-starting-directory"; const std::string FLAG_SET_PROJECT_WORKING_DIRECTORY0 = "-d"; const std::string FLAG_SET_PROJECT_WORKING_DIRECTORY1 = "-working-directory"; @@ -33,6 +35,8 @@ class CommandLineFlagHelper { } } else if(argString == FLAG_SET_PROJECT_FILE_PATH0 || argString == FLAG_SET_PROJECT_FILE_PATH1) { commandLineFlagResult.projectFilePath = std::string(this->args[argumentIndex + 1]); + } else if(argString == FLAG_SET_PROJECT_STARTING_DIRECTORY0 || argString == FLAG_SET_PROJECT_STARTING_DIRECTORY1) { + FileHelper::ChangeDirectory(this->args[argumentIndex + 1]); } else if(argString == FLAG_SET_PROJECT_WORKING_DIRECTORY0 || argString == FLAG_SET_PROJECT_WORKING_DIRECTORY1) { commandLineFlagResult.workingDirectoryOverride = this->args[argumentIndex + 1]; }