diff options
author | Dr. David von Oheimb <David.von.Oheimb@siemens.com> | 2021-01-07 10:16:12 +0100 |
---|---|---|
committer | Dr. David von Oheimb <dev@ddvo.net> | 2021-01-11 19:39:49 +0100 |
commit | 678cae0295e3fe600edc049742b8c765a58edebc (patch) | |
tree | ee4a876c65b769e987856cb440e4e9bd694333fc /apps/lib/opt.c | |
parent | 3372039252c4d9c67de784a0fbdad5589991a347 (diff) | |
download | openssl-new-678cae0295e3fe600edc049742b8c765a58edebc.tar.gz |
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/opt.c')
-rw-r--r-- | apps/lib/opt.c | 3 |
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. */ |