summaryrefslogtreecommitdiffstats
path: root/apps/openssl.c
diff options
context:
space:
mode:
authorRichard Levitte <levitte@openssl.org>2017-12-31 08:44:26 +0100
committerRichard Levitte <levitte@openssl.org>2018-01-06 19:27:57 +0100
commitda6be198f7ab690b8ace83f35502bca8dd9218e5 (patch)
treeb0c5a1d77e51283b2ed1a121646199c54b8beb29 /apps/openssl.c
parent391e987e9cd837446d3d0bf5505bbc7aa44b627e (diff)
Add the possibility to do 'openssl help [command]'
Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/5002)
Diffstat (limited to 'apps/openssl.c')
-rw-r--r--apps/openssl.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/apps/openssl.c b/apps/openssl.c
index dd7463edf3..4ab6be84b5 100644
--- a/apps/openssl.c
+++ b/apps/openssl.c
@@ -442,6 +442,8 @@ typedef enum HELP_CHOICE {
} HELP_CHOICE;
const OPTIONS help_options[] = {
+ {OPT_HELP_STR, 1, '-', "Usage: help [options]\n"},
+ {OPT_HELP_STR, 1, '-', " help [command]\n"},
{"help", OPT_hHELP, '-', "Display this summary"},
{NULL}
};
@@ -469,6 +471,14 @@ int help_main(int argc, char **argv)
}
}
+ if (opt_num_rest() == 1) {
+ char *new_argv[3];
+
+ new_argv[0] = opt_rest()[0];
+ new_argv[1] = "--help";
+ new_argv[2] = NULL;
+ return do_cmd(prog_init(), 2, new_argv);
+ }
if (opt_num_rest() != 0) {
BIO_printf(bio_err, "Usage: %s\n", prog);
return 1;