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
#include <QApplication>
#include <QDebug>
#include <QDesktopWidget>
#include <QCommandLineParser>
#include "rpcs3_app.h"
#ifdef _WIN32
#include <windows.h>
#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();
}