X-Git-Url: https://git.wpitchoune.net/gitweb/?a=blobdiff_plain;f=src%2Fmain.c;h=f25bee0d79da93df087d7e2173e6af03e7d8bc70;hb=3fb9b40025dd8aac7f9c899a4bddbd78ba51e2f6;hp=442a03f5be065ca0247f3c7ba2aeaa02bf86dc9d;hpb=39349bafd07309ee856e2f0c125c6b6500a67d43;p=psensor.git diff --git a/src/main.c b/src/main.c index 442a03f..f25bee0 100644 --- a/src/main.c +++ b/src/main.c @@ -346,7 +346,7 @@ static struct option long_options[] = { {"version", no_argument, 0, 'v'}, {"help", no_argument, 0, 'h'}, {"url", required_argument, 0, 'u'}, - {"debug", no_argument, 0, 'd'}, + {"debug", required_argument, 0, 'd'}, {0, 0, 0, 0} }; @@ -390,7 +390,7 @@ int main(int argc, char **argv) textdomain(PACKAGE); #endif - while ((optc = getopt_long(argc, argv, "vhdu:", long_options, + while ((optc = getopt_long(argc, argv, "vhd:u:", long_options, NULL)) != -1) { switch (optc) { case 'u': @@ -405,7 +405,7 @@ int main(int argc, char **argv) exit(EXIT_SUCCESS); case 'd': printf(_("Enables debug mode.\n")); - log_level = LOG_DEBUG; + log_level = atoi(optarg); break; default: cmdok = 0;