diff options
Diffstat (limited to 'src/yuzu_cmd/yuzu.cpp')
| -rw-r--r-- | src/yuzu_cmd/yuzu.cpp | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/src/yuzu_cmd/yuzu.cpp b/src/yuzu_cmd/yuzu.cpp index 1d951ca3f..27aba95f6 100644 --- a/src/yuzu_cmd/yuzu.cpp +++ b/src/yuzu_cmd/yuzu.cpp | |||
| @@ -56,9 +56,10 @@ static void PrintHelp(const char* argv0) { | |||
| 56 | std::cout << "Usage: " << argv0 | 56 | std::cout << "Usage: " << argv0 |
| 57 | << " [options] <filename>\n" | 57 | << " [options] <filename>\n" |
| 58 | "-g, --gdbport=NUMBER Enable gdb stub on port NUMBER\n" | 58 | "-g, --gdbport=NUMBER Enable gdb stub on port NUMBER\n" |
| 59 | "-f, --fullscreen Start in fullscreen mode\n" | 59 | "-f, --fullscreen Start in fullscreen mode\n" |
| 60 | "-h, --help Display this help and exit\n" | 60 | "-h, --help Display this help and exit\n" |
| 61 | "-v, --version Output version information and exit\n"; | 61 | "-v, --version Output version information and exit\n" |
| 62 | "-p, --program Pass following string as arguments to executable\n"; | ||
| 62 | } | 63 | } |
| 63 | 64 | ||
| 64 | static void PrintVersion() { | 65 | static void PrintVersion() { |
| @@ -103,15 +104,13 @@ int main(int argc, char** argv) { | |||
| 103 | bool fullscreen = false; | 104 | bool fullscreen = false; |
| 104 | 105 | ||
| 105 | static struct option long_options[] = { | 106 | static struct option long_options[] = { |
| 106 | {"gdbport", required_argument, 0, 'g'}, | 107 | {"gdbport", required_argument, 0, 'g'}, {"fullscreen", no_argument, 0, 'f'}, |
| 107 | {"fullscreen", no_argument, 0, 'f'}, | 108 | {"help", no_argument, 0, 'h'}, {"version", no_argument, 0, 'v'}, |
| 108 | {"help", no_argument, 0, 'h'}, | 109 | {"program", optional_argument, 0, 'p'}, {0, 0, 0, 0}, |
| 109 | {"version", no_argument, 0, 'v'}, | ||
| 110 | {0, 0, 0, 0}, | ||
| 111 | }; | 110 | }; |
| 112 | 111 | ||
| 113 | while (optind < argc) { | 112 | while (optind < argc) { |
| 114 | char arg = getopt_long(argc, argv, "g:fhv", long_options, &option_index); | 113 | char arg = getopt_long(argc, argv, "g:fhvp::", long_options, &option_index); |
| 115 | if (arg != -1) { | 114 | if (arg != -1) { |
| 116 | switch (arg) { | 115 | switch (arg) { |
| 117 | case 'g': | 116 | case 'g': |
| @@ -135,6 +134,10 @@ int main(int argc, char** argv) { | |||
| 135 | case 'v': | 134 | case 'v': |
| 136 | PrintVersion(); | 135 | PrintVersion(); |
| 137 | return 0; | 136 | return 0; |
| 137 | case 'p': | ||
| 138 | Settings::values.program_args = argv[optind]; | ||
| 139 | ++optind; | ||
| 140 | break; | ||
| 138 | } | 141 | } |
| 139 | } else { | 142 | } else { |
| 140 | #ifdef _WIN32 | 143 | #ifdef _WIN32 |