Skip to content

Commit

Permalink
Added start directory command line flag.
Browse files Browse the repository at this point in the history
  • Loading branch information
Chukobyte committed Jun 7, 2021
1 parent ab3e132 commit c994811
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
11 changes: 11 additions & 0 deletions docs/general/command_line_flags.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`
Expand Down
4 changes: 4 additions & 0 deletions src/core/utils/command_line_flag_helper.h
Original file line number Diff line number Diff line change
Expand Up @@ -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";

Expand All @@ -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];
}
Expand Down

0 comments on commit c994811

Please sign in to comment.