File tree 3 files changed +22
-21
lines changed
3 files changed +22
-21
lines changed Original file line number Diff line number Diff line change @@ -10,19 +10,19 @@ FusionCLI::FusionCLI(QObject *parent) : QObject(parent)
10
10
}
11
11
12
12
13
- void FusionCLI::execute (int argc, char *argv[] ) {
13
+ void FusionCLI::execute (int argc, QStringList args ) {
14
14
15
- if (argc>1 )
15
+ if (argc>1 )
16
16
{
17
- QString arg = argv [1 ];
17
+ QString arg = args [1 ];
18
18
if (arg==" -g" ||arg==" --allGames" )
19
19
getAllGames ();
20
20
else if (arg==" -r" ||arg==" --refresh" )
21
21
refreshList ();
22
22
else if (arg==" -l" ||arg==" --launch" )
23
- launchByID (QString (argv [2 ]) );
23
+ launchByID (args [2 ]);
24
24
else if (arg==" -i" ||arg==" --gameInfo" ) {
25
- getGameByID (QString (argv [2 ]) );
25
+ getGameByID (args [2 ]);
26
26
}
27
27
}
28
28
}
Original file line number Diff line number Diff line change @@ -15,7 +15,7 @@ class FusionCLI : public QObject
15
15
Q_OBJECT
16
16
public:
17
17
explicit FusionCLI (QObject *parent = 0 );
18
- void execute (int argc, char *argv[] );
18
+ void execute (int argc, QStringList args );
19
19
void refreshList ();
20
20
void launchByID (QString ID);
21
21
signals:
Original file line number Diff line number Diff line change @@ -74,29 +74,30 @@ int main(int argc, char *argv[])
74
74
75
75
qDebug () << " Args " <<args;
76
76
77
-
78
-
79
77
if (argc<=1 ) {
80
- qout << " Fusion Commandline-Interface" << endl <<endl;
81
- qout << " Usage: fusioncli [options]" << endl;
82
- qout << " --allGames -g: Get all Games with all Info" << endl<<endl;
78
+ qout << " Fusion Commandline-Interface" << endl <<endl;
79
+ qout << " Usage: fusioncli [options]" << endl;
80
+ qout << " --allGames | -g : Get all Games with all Info" << endl;
81
+ qout << " --refresh | -r : Refresh Infos from Database" << endl;
82
+ qout << " --launch [ID] | -l [ID]: Launch Game with ID" << endl;
83
+ qout << " --gameInfo [ID] | -i [ID]: Get info for Game-ID" << endl << endl;
84
+
83
85
84
86
QTimer::singleShot (10 , &a, SLOT (quit ()));
85
87
#ifdef DEBUG_TEST
86
88
dbgFile.close ();
87
89
delete dbgStream;
88
90
#endif
89
- }
90
-
91
- FusionCLI cli;
92
- cli.execute (argc, argv);
91
+ } else {
92
+ FusionCLI cli;
93
+ cli.execute (argc, args);
93
94
94
- QTimer::singleShot (10 , &a, SLOT (quit ()));
95
-
96
- #ifdef DEBUG_TEST
97
- dbgFile.close ();
98
- delete dbgStream;
99
- #endif
95
+ QTimer::singleShot (10 , &a, SLOT (quit ()));
100
96
97
+ #ifdef DEBUG_TEST
98
+ dbgFile.close ();
99
+ delete dbgStream;
100
+ #endif
101
+ }
101
102
return a.exec ();
102
103
}
You can’t perform that action at this time.
0 commit comments