summaryrefslogtreecommitdiff
path: root/Source/Core/DolphinWX/src/MainNoGUI.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Source/Core/DolphinWX/src/MainNoGUI.cpp')
-rw-r--r--Source/Core/DolphinWX/src/MainNoGUI.cpp30
1 files changed, 19 insertions, 11 deletions
diff --git a/Source/Core/DolphinWX/src/MainNoGUI.cpp b/Source/Core/DolphinWX/src/MainNoGUI.cpp
index 917e51ee35..2389cf017d 100644
--- a/Source/Core/DolphinWX/src/MainNoGUI.cpp
+++ b/Source/Core/DolphinWX/src/MainNoGUI.cpp
@@ -59,23 +59,31 @@ void Host_UpdateStatusBar(const char* _pText){}
// Include SDL header so it can hijack main().
#include <SDL.h>
+#include "cmdline.h"
int main(int argc, char* argv[])
{
- if (argc != 2)
- {
- puts("Please supply at least one argument - the ISO to boot.\n");
- return(1);
- }
- std::string bootFile(argv[1]);
-
- DetectCPU();
- BootManager::BootCore(bootFile);
- usleep(2000 * 1000 * 1000);
+ gengetopt_args_info args_info;
+
+ if (cmdline_parser (argc, argv, &args_info) != 0)
+ return(1);
+
+ if (args_info.inputs_num < 1)
+ {
+ fprintf(stderr, "Please supply at least one argument - the ISO to boot.\n");
+ return(1);
+ }
+ std::string bootFile(args_info.inputs[0]);
+
+ DetectCPU();
+ BootManager::BootCore(bootFile);
+ usleep(2000 * 1000 * 1000);
// while (!getch()) {
// usleep(20);
// }
- return(0);
+
+ cmdline_parser_free (&args_info);
+ return(0);
}