updated checkpatch.pl
[psensor.git] / src / main.c
index 442a03f..ae63a1e 100644 (file)
@@ -74,11 +74,12 @@ static const char *program_name;
 static void print_version()
 {
        printf("psensor %s\n", VERSION);
-       printf(_("Copyright (C) %s jeanfi@gmail.com\n\
-License GPLv2: GNU GPL version 2 or later \
-<http://www.gnu.org/licenses/old-licenses/gpl-2.0.html>\n\
-This is free software: you are free to change and redistribute it.\n\
-There is NO WARRANTY, to the extent permitted by law.\n"),
+       printf(_("Copyright (C) %s jeanfi@gmail.com\n"
+                "License GPLv2: GNU GPL version 2 or later "
+                "<http://www.gnu.org/licenses/old-licenses/gpl-2.0.html>\n"
+                "This is free software: you are free to change and "
+                " redistribute it.\n"
+                "There is NO WARRANTY, to the extent permitted by law.\n"),
               "2010-2011");
 }
 
@@ -91,15 +92,18 @@ static void print_help()
 
        puts("");
        puts(_("Options:"));
-       puts(_("\
-  -h, --help          display this help and exit\n\
-  -v, --version       display version information and exit"));
+       puts(_("  -h, --help          display this help and exit\n"
+              "  -v, --version       display version information and exit"));
 
        puts("");
 
-       puts(_("\
-  -u, --url=URL       \
-the URL of the psensor-server, example: http://hostname:3131"));
+       puts(_("  -u, --url=URL       "
+              "the URL of the psensor-server, example: http://hostname:3131"));
+
+       puts("");
+
+       puts(_("  -d, --debug=LEVEL   "
+              "set the debug level, integer between 0 and 3"));
 
        puts("");
 
@@ -346,7 +350,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 +394,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 +409,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;