3 * Authors: Petr Kubiznak,...
6 #include "ui/console/console.h"
7 #include "ui/qt/qt_gui.h"
8 #include "exceptions/GeneralException.h"
13 /* -------------------------------------------------------------------------- */
15 /* tiskne kratkou napovedu */
17 cout
<< endl
<< "NAME" << endl
;
18 cout
<< "\tMines3D - Search mines in three dimensions!" << endl
<< endl
;
20 cout
<< "SYNOPSIS:" << endl
;
21 cout
<< "\tmines3d [OPTION]" << endl
<< endl
;
23 cout
<< "OPTIONS" << endl
;
24 cout
<< "\t-console" << endl
<< "\t\tRun in a console mode. Implicitly, the program starts in a graphic mode." << endl
<< endl
;
25 cout
<< "\t-help" << endl
<< "\t\tDisplays this help." << endl
<< endl
;
27 cout
<< "CREDITS" << endl
;
28 cout
<< "\t\302\251 Petr Kubiz\305\210\303\241k, Czech Technical University in Prague, 2010" << endl
;
29 cout
<< "\tCreated as a semestral project on subject Y36PJC." << endl
<< endl
;
30 cout
<< "\tThanks to Petra Mertl\303\255kov\303\241 for a theme suggestion and long-term support." << endl
<< endl
;
33 /* -------------------------------------------------------------------------- */
35 int main(int argc
, char *argv
[]) {
39 cout
<< "Starting graphical mode." << endl
;
40 cout
<< "To run in a text mode, use argument \"-console\"." << endl
;
45 if(!strcmp(argv
[1], "-console")) { consoleMain(); break; } //spusteni programu v console modu
46 if(!strcmp(argv
[1], "-help")) { printHelp(); break; }
49 cerr
<< "Invalid calling seqence." << endl
;
50 cerr
<< "Call \"" << argv
[0] << "\" to run the program." << endl
;
51 cerr
<< "Use \"-help\" argument to display help." << endl
;
55 } catch(GeneralException e
) {
56 cerr
<< "Program terminated incorrectly with error message:" << endl
57 << e
.errText
<< " (" << e
.errCode
<< ")" << endl
;
59 cerr
<< "Program terminated incorrectly with unknown error." << endl
;