Add ability to boot elves in command line. (#2859)

This commit is contained in:
Robbie 2017-06-12 10:47:26 -05:00 committed by Ani
parent a3d1f7b7b0
commit 5c7a4b1405

View File

@ -2,13 +2,15 @@
// by Sacha Refshauge // by Sacha Refshauge
#include <QApplication> #include <QApplication>
#include <QDebug> #include <QCommandLineParser>
#include <QDesktopWidget>
#include "rpcs3_app.h" #include "rpcs3_app.h"
#ifdef _WIN32 #ifdef _WIN32
#include <windows.h> #include <windows.h>
#endif #endif
inline std::string sstr(const QString& _in) { return _in.toUtf8().toStdString(); }
int main(int argc, char** argv) int main(int argc, char** argv)
{ {
#ifdef _WIN32 #ifdef _WIN32
@ -18,6 +20,22 @@ int main(int argc, char** argv)
#endif #endif
rpcs3_app app(argc, argv); 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(); app.Init();
if (parser.positionalArguments().length() > 0)
{
Emu.SetPath(sstr(parser.positionalArguments().at(0)));
Emu.Load();
Emu.Run();
}
return app.exec(); return app.exec();
} }