From 1732705e6226c459681d3c76612d9065479e2c86 Mon Sep 17 00:00:00 2001 From: Ilari Liusvaara Date: Mon, 11 Feb 2013 00:09:49 +0200 Subject: [PATCH] Wxwidgets: Support -h and --help --- src/platform/wxwidgets/main.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/platform/wxwidgets/main.cpp b/src/platform/wxwidgets/main.cpp index 1e8c34fb..1c9664d5 100644 --- a/src/platform/wxwidgets/main.cpp +++ b/src/platform/wxwidgets/main.cpp @@ -319,6 +319,7 @@ private: std::string c_rom; std::string c_file; std::vector c_lua; + bool exit_immediately; }; IMPLEMENT_APP(lsnes_app) @@ -326,6 +327,7 @@ IMPLEMENT_APP(lsnes_app) lsnes_app::lsnes_app() { settings_mode = false; + exit_immediately = false; } void lsnes_app::OnInitCmdLine(wxCmdLineParser& parser) @@ -341,6 +343,15 @@ bool lsnes_app::OnCmdLineParsed(wxCmdLineParser& parser) cmdline.push_back(tostdstring(parser.GetParam(i))); for(auto i: cmdline) { regex_results r; + if(i == "--help" || i == "-h") { + std::cout << "--settings: Show the settings dialog" << std::endl; + std::cout << "--rom=: Load specified ROM on startup" << std::endl; + std::cout << "--load=: Load specified save/movie on starup" << std::endl; + std::cout << "--lua=: Load specified Lua script on startup" << std::endl; + std::cout << ": Load specified ROM on startup" << std::endl; + exit_immediately = true; + return true; + } if(i == "--settings") settings_mode = true; if(r = regex("--rom=(.+)", i)) @@ -359,6 +370,8 @@ bool lsnes_app::OnCmdLineParsed(wxCmdLineParser& parser) bool lsnes_app::OnInit() { wxApp::OnInit(); + if(exit_immediately) + return false; reached_main(); set_random_seed(); -- 2.11.4.GIT