Using '?' as option did not work, and would be strange to pass anyway,
because it's a glob char for the shell and you would have to escape it
like ./ubihealthd -\? … use the more common -h/--help instead.
Note: this does not touch the output, just changes the options itself.
Signed-off-by: Alexander Dahl <post@lespocky.de>
Acked-by: Richard Weinberger <richard@nod.at>
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
static int interval_secs = 120;
static int nodaemon;
-static const char opt_string[] = "d:i:f";
+static const char opt_string[] = "d:i:fh";
static const struct option options[] = {
{
.name = "device",
.flag = NULL,
.val = 'i'
},
+ {
+ .name = "help",
+ .has_arg = no_argument,
+ .flag = NULL,
+ .val = 'h'
+ },
{ /* sentinel */ }
};
nodaemon = 1;
break;
}
- case '?':
+ case 'h':
default:
fprintf(stderr, "Usage: %s [ -d UBI_DEVICE ] [-i INTERVAL_SEC ] [ -f ]\n", argv[0]);
exit(1);