Line data Source code
1 : #include <QtWidgets/qdesktopwidget.h>
2 : #include <QtWidgets/QApplication>
3 : #include <cstdio>
4 : #include <iostream>
5 :
6 : #include "mfextensions/Binaries/mvdlg.hh"
7 :
8 0 : void print_usage()
9 : {
10 : std::cout << "usage: msgviewer [options]\n"
11 : << "allowed options:\n"
12 : << " -h [ --help ] display this help message\n"
13 0 : << " -c [ --configuration ] arg specify the configuration file to msgviewer\n";
14 0 : }
15 :
16 0 : int main(int argc, char** argv)
17 : {
18 0 : QApplication app(argc, argv);
19 :
20 0 : std::string conf = std::string();
21 :
22 0 : if (argc > 1)
23 : {
24 0 : for (int i = 1; i < argc; ++i)
25 : {
26 0 : if ((strcmp(argv[i], "-h") == 0) || (strcmp(argv[i], "--help") == 0)) // NOLINT(cppcoreguidelines-pro-bounds-pointer-arithmetic)
27 : {
28 0 : print_usage();
29 0 : return 0;
30 : }
31 :
32 0 : if (((strcmp(argv[i], "-c") == 0) || (strcmp(argv[i], "--configuration") == 0)) && i < argc - 1) // NOLINT(cppcoreguidelines-pro-bounds-pointer-arithmetic)
33 : {
34 0 : conf = std::string(argv[i + 1]); // NOLINT(cppcoreguidelines-pro-bounds-pointer-arithmetic)
35 0 : ++i;
36 : }
37 :
38 : else
39 : {
40 0 : std::cout << "unknown option: " << argv[i] << "\n"; // NOLINT(cppcoreguidelines-pro-bounds-pointer-arithmetic)
41 0 : print_usage();
42 0 : return -1;
43 : }
44 : }
45 : }
46 :
47 0 : msgViewerDlg dialog(conf);
48 0 : dialog.setWindowFlags(Qt::Window);
49 0 : dialog.show();
50 :
51 0 : return QApplication::exec();
52 :
53 : return 0;
54 0 : }
|