1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-04 12:00:25 +00:00

Add support for command-line user arguments.

Implements the standard Unix double dash (--) commandline argument:
* Arguments after a double dash (--) are ignored by Godot and stored for the user.
* User can access them via `OS.get_cmdline_user_args()`

Example:

`godot.exe scene_to_run.tscn --fullscreen -- --start-level 2`
This commit is contained in:
Juan Linietsky
2022-07-29 15:30:52 +02:00
parent 6d599ed90b
commit 0dd65378e7
7 changed files with 41 additions and 6 deletions

View File

@@ -105,7 +105,7 @@ int test_main(int argc, char *argv[]) {
for (int i = 0; i < argc; i++) {
args.push_back(String::utf8(argv[i]));
}
OS::get_singleton()->set_cmdline("", args);
OS::get_singleton()->set_cmdline("", args, List<String>());
// Run custom test tools.
if (test_commands) {