From 5fb796fd1949fdcb27de5fa9dc7a6b7bd237c67d Mon Sep 17 00:00:00 2001 From: nakeee Date: Sun, 7 Sep 2008 20:24:05 +0000 Subject: 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 --- Source/Core/DolphinWX/src/MainNoGUI.cpp | 30 +++++++++++++++++++----------- 1 file changed, 19 insertions(+), 11 deletions(-) (limited to 'Source/Core/DolphinWX/src/MainNoGUI.cpp') 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 +#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); } -- cgit v1.2.3