aboutsummaryrefslogtreecommitdiff
path: root/ubi-utils
diff options
context:
space:
mode:
authorAlexander Dahl <post@lespocky.de>2019-10-03 08:35:01 +0200
committerDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2019-10-07 10:14:49 +0200
commite0fecfef3463f9585fef878aba60b0b92b9ffc08 (patch)
tree48a79ba0ace4322029207b74d04c7876d8367499 /ubi-utils
parentab886a5a7e6c1f135f9f672811920322318003c9 (diff)
ubihealthd: Add option -h/--help
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>
Diffstat (limited to 'ubi-utils')
-rw-r--r--ubi-utils/ubihealthd.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/ubi-utils/ubihealthd.c b/ubi-utils/ubihealthd.c
index f38235b..27799f7 100644
--- a/ubi-utils/ubihealthd.c
+++ b/ubi-utils/ubihealthd.c
@@ -42,7 +42,7 @@ static int ubi_fd;
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",
@@ -56,6 +56,12 @@ static const struct option options[] = {
.flag = NULL,
.val = 'i'
},
+ {
+ .name = "help",
+ .has_arg = no_argument,
+ .flag = NULL,
+ .val = 'h'
+ },
{ /* sentinel */ }
};
@@ -238,7 +244,7 @@ int main (int argc, char *argv[])
nodaemon = 1;
break;
}
- case '?':
+ case 'h':
default:
fprintf(stderr, "Usage: %s [ -d UBI_DEVICE ] [-i INTERVAL_SEC ] [ -f ]\n", argv[0]);
exit(1);