diff options
| author | nakeee <nakeee@gmail.com> | 2008-09-07 20:24:05 +0000 |
|---|---|---|
| committer | nakeee <nakeee@gmail.com> | 2008-09-07 20:24:05 +0000 |
| commit | 5fb796fd1949fdcb27de5fa9dc7a6b7bd237c67d (patch) | |
| tree | 916a6970b1f555279dace575c7f205e04ec2a420 /Source/Core/DolphinWX/src/MainNoGUI.cpp | |
| parent | 885e1c51853c56c4b254b5f4d73543b1423e1ba0 (diff) | |
use gen get opts for parsing MainNoGui command line, this doesn't do much yet
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@472 8ced0084-cf51-0410-be5f-012b33b47a6e
Diffstat (limited to 'Source/Core/DolphinWX/src/MainNoGUI.cpp')
| -rw-r--r-- | Source/Core/DolphinWX/src/MainNoGUI.cpp | 30 |
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); } |
