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");
}
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("");
{"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}
};
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':
exit(EXIT_SUCCESS);
case 'd':
printf(_("Enables debug mode.\n"));
- log_level = LOG_DEBUG;
+ log_level = atoi(optarg);
break;
default:
cmdok = 0;