Skip to content

Commit

Permalink
Add the possibility to do 'openssl help [command]'
Browse files Browse the repository at this point in the history
Reviewed-by: Rich Salz <[email protected]>
(Merged from openssl#5002)
  • Loading branch information
levitte committed Jan 6, 2018
1 parent 391e987 commit da6be19
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions apps/openssl.c
Original file line number Diff line number Diff line change
Expand Up @@ -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}
};
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit da6be19

Please sign in to comment.