]> rtime.felk.cvut.cz Git - frescor/frsh.git/blob - fres/frm_gui/main.cpp
frm_gui: Compilation fixes
[frescor/frsh.git] / fres / frm_gui / main.cpp
1 #include <QtGui/QApplication>
2 #include "dialog.h"
3 #include <getopt.h>
4 #include <ul_logreg.h>
5 #include <stdio.h>
6
7 static struct option long_opts[] = {
8     { "loglevel", 1, 0, 'l' },
9     { 0, 0, 0, 0}
10 };
11
12 static void
13 usage(void)
14 {
15         printf("usage: frm_gui [ options ]\n");
16         printf("  -l, --loglevel <number>|<domain>=<number>,...\n");
17 }
18
19 int main(int argc, char *argv[])
20 {
21     QApplication a(argc, argv);
22     Dialog w;
23     char opt;
24
25     while ((opt = getopt_long(argc, argv, "l:", &long_opts[0], NULL)) != EOF) {
26         switch (opt) {
27             case 'l':
28                 ul_log_domain_arg2levels(optarg);
29                 break;
30             case 'h':
31                 /*default:*/
32                 usage();
33                 exit(opt == 'h' ? 0 : 1);
34         }
35     }
36
37     w.show();
38     return a.exec();
39 }