]> rtime.felk.cvut.cz Git - frescor/frsh.git/blobdiff - fres/frm_gui/main.cpp
frm_gui: Compilation fixes
[frescor/frsh.git] / fres / frm_gui / main.cpp
index 78b5eb65586e1dcb4da3fd494e1f77b7f9534b11..1002dd4e0dc2da2493e82dd6a2d8ab54e888847f 100644 (file)
@@ -1,10 +1,39 @@
 #include <QtGui/QApplication>
 #include "dialog.h"
+#include <getopt.h>
+#include <ul_logreg.h>
+#include <stdio.h>
+
+static struct option long_opts[] = {
+    { "loglevel", 1, 0, 'l' },
+    { 0, 0, 0, 0}
+};
+
+static void
+usage(void)
+{
+       printf("usage: frm_gui [ options ]\n");
+       printf("  -l, --loglevel <number>|<domain>=<number>,...\n");
+}
 
 int main(int argc, char *argv[])
 {
     QApplication a(argc, argv);
     Dialog w;
+    char opt;
+
+    while ((opt = getopt_long(argc, argv, "l:", &long_opts[0], NULL)) != EOF) {
+       switch (opt) {
+           case 'l':
+               ul_log_domain_arg2levels(optarg);
+               break;
+           case 'h':
+               /*default:*/
+               usage();
+               exit(opt == 'h' ? 0 : 1);
+       }
+    }
+
     w.show();
     return a.exec();
 }