From 505dd4d9170c1435777eb6fcd306d078056ea35e Mon Sep 17 00:00:00 2001 From: gramanas Date: Thu, 18 Oct 2018 11:19:36 +0300 Subject: Add man option to help --- src/actions.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'src/actions.c') diff --git a/src/actions.c b/src/actions.c index 501d952..417f9ce 100644 --- a/src/actions.c +++ b/src/actions.c @@ -269,9 +269,23 @@ int run_SEARCH(UserOpt *opt, Conf *conf) { int run_HELP(UserOpt *opt, Conf *conf) { UNUSED(conf); + char tmp[STR_M]; + if (strcmp(list_get(opt->args), "man") == 0) { +#define X(ACTION) \ + get_possible_action_strings(tmp, CKA_##ACTION); \ + HELP("%s:\n%s", #ACTION, tmp); \ + print_##ACTION##_help(); \ + HELP(""); + CK_ACTIONS +#undef X + return 0; + } + switch(parser_get_action(list_get(opt->args), NULL)) { #define X(ACTION) \ case CKA_##ACTION: \ + get_possible_action_strings(tmp, CKA_##ACTION); \ + HELP("%s:\n%s", #ACTION, tmp); \ print_##ACTION##_help(); \ return 0; CK_ACTIONS -- cgit v1.2.3