summaryrefslogtreecommitdiff
path: root/src/nspawn
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2018-05-22 14:28:38 +0200
committerGitHub <noreply@github.com>2018-05-22 14:28:38 +0200
commitc0d7a4f0cd7ccb80a9816a1fb2ee77ed86383768 (patch)
tree2376e4d3ab5c17f04599d626a1df69132cbdc5da /src/nspawn
parentc1104417b7ea2e115a2228dbf3a82b553fff2ffe (diff)
parent398246292e8e5279b7cf77be733ab73f670d7495 (diff)
downloadsystemd-c0d7a4f0cd7ccb80a9816a1fb2ee77ed86383768.tar.gz
Merge pull request #9061 from poettering/dump-string-table
add new DUMP_STRING_TABLE() macro and make use of it everywhere
Diffstat (limited to 'src/nspawn')
-rw-r--r--src/nspawn/nspawn.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/src/nspawn/nspawn.c b/src/nspawn/nspawn.c
index b5d9de8da0..762747686a 100644
--- a/src/nspawn/nspawn.c
+++ b/src/nspawn/nspawn.c
@@ -90,6 +90,7 @@
#include "socket-util.h"
#include "stat-util.h"
#include "stdio-util.h"
+#include "string-table.h"
#include "string-util.h"
#include "strv.h"
#include "terminal-util.h"
@@ -916,7 +917,10 @@ static int parse_argv(int argc, char *argv[]) {
if (!optarg)
arg_volatile_mode = VOLATILE_YES;
- else {
+ else if (streq(optarg, "help")) {
+ DUMP_STRING_TABLE(volatile_mode, VolatileMode, _VOLATILE_MODE_MAX);
+ return 0;
+ } else {
VolatileMode m;
m = volatile_mode_from_string(optarg);
@@ -1024,6 +1028,11 @@ static int parse_argv(int argc, char *argv[]) {
break;
case ARG_KILL_SIGNAL:
+ if (streq(optarg, "help")) {
+ DUMP_STRING_TABLE(signal, int, _NSIG);
+ return 0;
+ }
+
arg_kill_signal = signal_from_string(optarg);
if (arg_kill_signal < 0) {
log_error("Cannot parse signal: %s", optarg);
@@ -1153,6 +1162,11 @@ static int parse_argv(int argc, char *argv[]) {
char *name;
int rl;
+ if (streq(optarg, "help")) {
+ DUMP_STRING_TABLE(rlimit, int, _RLIMIT_MAX);
+ return 0;
+ }
+
eq = strchr(optarg, '=');
if (!eq) {
log_error("--rlimit= expects an '=' assignment.");