summaryrefslogtreecommitdiffstats
path: root/apps/lib
diff options
context:
space:
mode:
authorDr. David von Oheimb <David.von.Oheimb@siemens.com>2021-01-07 10:16:12 +0100
committerDr. David von Oheimb <dev@ddvo.net>2021-01-11 19:39:49 +0100
commit678cae0295e3fe600edc049742b8c765a58edebc (patch)
treeee4a876c65b769e987856cb440e4e9bd694333fc /apps/lib
parent3372039252c4d9c67de784a0fbdad5589991a347 (diff)
APPS: Print help also on -h and --h; print high-level help when no cmd given
Reviewed-by: Tomas Mraz <tmraz@fedoraproject.org> (Merged from https://github.com/openssl/openssl/pull/13799)
Diffstat (limited to 'apps/lib')
-rw-r--r--apps/lib/opt.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/apps/lib/opt.c b/apps/lib/opt.c
index 5ddf1c7a74..22d4138301 100644
--- a/apps/lib/opt.c
+++ b/apps/lib/opt.c
@@ -732,7 +732,8 @@ int opt_next(void)
*arg++ = '\0';
for (o = opts; o->name; ++o) {
/* If not this option, move on to the next one. */
- if (strcmp(p, o->name) != 0)
+ if (!(strcmp(p, "h") == 0 && strcmp(o->name, "help") == 0)
+ && strcmp(p, o->name) != 0)
continue;
/* If it doesn't take a value, make sure none was given. */