00001 #include <QtWidgets/qdesktopwidget.h>
00002 #include <stdio.h>
00003 #include <QtWidgets/QApplication>
00004 #include <iostream>
00005
00006 #include "mfextensions/Binaries/mvdlg.hh"
00007
00008 void print_usage() {
00009 std::cout << "usage: msgviewer [options]\n"
00010 << "allowed options:\n"
00011 << " -h [ --help ] display this help message\n"
00012 << " -c [ --configuration ] arg specify the configuration file to msgviewer\n";
00013 }
00014
00015 int main(int argc, char** argv) {
00016 QApplication app(argc, argv);
00017
00018 std::string conf = std::string();
00019
00020 if (argc > 1) {
00021 for (int i = 1; i < argc; ++i) {
00022 if (!strcmp(argv[i], "-h") || !strcmp(argv[i], "--help")) {
00023 print_usage();
00024 return 0;
00025 }
00026
00027 else if ((!strcmp(argv[i], "-c") || !strcmp(argv[i], "--configuration")) && i < argc - 1) {
00028 conf = std::string(argv[i + 1]);
00029 ++i;
00030 }
00031
00032 else {
00033 std::cout << "unknown option: " << argv[i] << "\n";
00034 print_usage();
00035 return -1;
00036 }
00037 }
00038 }
00039
00040 msgViewerDlg dialog(conf);
00041 dialog.setWindowFlags(Qt::Window);
00042 dialog.show();
00043
00044 return app.exec();
00045
00046 return 0;
00047 }