From: Lennart Poettering Date: Tue, 22 May 2018 10:10:56 +0000 (+0200) Subject: tree-wide: port various bits of the tree over to the new DUMP_STRING_TABLE() macro X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=c401e41484ceba52cf56879e667ca5e23433cfb6;p=elogind.git tree-wide: port various bits of the tree over to the new DUMP_STRING_TABLE() macro --- diff --git a/src/login/loginctl.c b/src/login/loginctl.c index 9badf8e68..6b4c381f0 100644 --- a/src/login/loginctl.c +++ b/src/login/loginctl.c @@ -29,6 +29,7 @@ #include "sigbus.h" #include "signal-util.h" #include "spawn-polkit-agent.h" +//#include "string-table.h" #include "strv.h" #include "sysfs-show.h" #include "terminal-util.h" @@ -1507,6 +1508,11 @@ static int parse_argv(int argc, char *argv[]) { break; case 'o': + if (streq(optarg, "help")) { + DUMP_STRING_TABLE(output_mode, OutputMode, _OUTPUT_MODE_MAX); + return 0; + } + arg_output = output_mode_from_string(optarg); if (arg_output < 0) { log_error("Unknown output '%s'.", optarg); @@ -1546,6 +1552,11 @@ static int parse_argv(int argc, char *argv[]) { break; case 's': + if (streq(optarg, "help")) { + DUMP_STRING_TABLE(signal, int, _NSIG); + return 0; + } + arg_signal = signal_from_string(optarg); if (arg_signal < 0) { log_error("Failed to parse signal string %s.", optarg);