chiark / gitweb /
tree-wide: port various bits of the tree over to the new DUMP_STRING_TABLE() macro
authorLennart Poettering <lennart@poettering.net>
Tue, 22 May 2018 10:10:56 +0000 (12:10 +0200)
committerSven Eden <yamakuzure@gmx.net>
Fri, 24 Aug 2018 14:47:08 +0000 (16:47 +0200)
src/login/loginctl.c

index 9badf8e6837c1df7788dc884de2eb219ed107c82..6b4c381f0d3fde01b426fe6b2fc56aff3e57bfae 100644 (file)
@@ -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);