From b2cca4dec3c7bd9f26935888d95cee934105787f Mon Sep 17 00:00:00 2001 From: Michal Sojka Date: Thu, 28 May 2009 05:41:59 +0200 Subject: [PATCH] frm_gui learned -l (--loglevel) option --- fres/frm_gui/main.cpp | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/fres/frm_gui/main.cpp b/fres/frm_gui/main.cpp index 78b5eb6..8dff27e 100644 --- a/fres/frm_gui/main.cpp +++ b/fres/frm_gui/main.cpp @@ -1,10 +1,38 @@ #include #include "dialog.h" +#include +#include + +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 |=,...\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(); } -- 2.39.2