diff options
author | bruvzg <7645683+bruvzg@users.noreply.github.com> | 2022-07-07 10:57:22 +0300 |
---|---|---|
committer | bruvzg <7645683+bruvzg@users.noreply.github.com> | 2022-07-07 12:11:31 +0300 |
commit | 238ac2fdd5e9d93f51a32d9341c5b70eb66bb491 (patch) | |
tree | 3fae36eda29ef52d5c8d3fd27c3d957c55e45153 /main/main.cpp | |
parent | 8ec6c075bd38620358c1cadafa1a515a5711695a (diff) |
[macOS] Improve file association handling, and allow URL schema handling.
Diffstat (limited to 'main/main.cpp')
-rw-r--r-- | main/main.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/main/main.cpp b/main/main.cpp index f7c192001b..eb401cd9ef 100644 --- a/main/main.cpp +++ b/main/main.cpp @@ -621,11 +621,18 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph /* argument parsing and main creation */ List<String> args; List<String> main_args; + List<String> platform_args = OS::get_singleton()->get_cmdline_platform_args(); + // Add command line arguments. for (int i = 0; i < argc; i++) { args.push_back(String::utf8(argv[i])); } + // Add arguments received from macOS LaunchService (URL schemas, file associations). + for (const String &arg : platform_args) { + args.push_back(arg); + } + List<String>::Element *I = args.front(); while (I) { |