From 5c7a4b14052470c4b8c3f321fd893ee9b10ee616 Mon Sep 17 00:00:00 2001 From: Robbie Date: Mon, 12 Jun 2017 10:47:26 -0500 Subject: [PATCH] Add ability to boot elves in command line. (#2859) --- rpcs3/main.cpp | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/rpcs3/main.cpp b/rpcs3/main.cpp index 4d69d93973..d21915ea39 100644 --- a/rpcs3/main.cpp +++ b/rpcs3/main.cpp @@ -2,13 +2,15 @@ // by Sacha Refshauge #include -#include -#include +#include + #include "rpcs3_app.h" #ifdef _WIN32 #include #endif +inline std::string sstr(const QString& _in) { return _in.toUtf8().toStdString(); } + int main(int argc, char** argv) { #ifdef _WIN32 @@ -18,6 +20,22 @@ int main(int argc, char** argv) #endif rpcs3_app app(argc, argv); + + // Command line args + QCommandLineParser parser; + parser.setApplicationDescription("Welcome to RPCS3 command line."); + parser.addPositionalArgument("(S)ELF", "Path for directly executing a (S)ELF"); + parser.addHelpOption(); + parser.process(app); + app.Init(); + + if (parser.positionalArguments().length() > 0) + { + Emu.SetPath(sstr(parser.positionalArguments().at(0))); + Emu.Load(); + Emu.Run(); + } + return app.exec(); }