summaryrefslogtreecommitdiff
path: root/src/basic/runtime-scope.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2023-03-09 17:41:25 +0100
committerLennart Poettering <lennart@poettering.net>2023-03-10 09:47:58 +0100
commit40d73340faabb6073602ba3ff41896f3478a2cbf (patch)
treebee3bf080c849adca0827b79d3f16dd7914782d5 /src/basic/runtime-scope.c
parent4870133bfaaf97189a970a29bf47e0e38fa721aa (diff)
downloadsystemd-40d73340faabb6073602ba3ff41896f3478a2cbf.tar.gz
runtime-scope: add helper that turns RuntimeScope enum into --system/--user string
Diffstat (limited to 'src/basic/runtime-scope.c')
-rw-r--r--src/basic/runtime-scope.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/basic/runtime-scope.c b/src/basic/runtime-scope.c
index 88afb53d0b..3d653d6cef 100644
--- a/src/basic/runtime-scope.c
+++ b/src/basic/runtime-scope.c
@@ -10,3 +10,11 @@ static const char* const runtime_scope_table[_RUNTIME_SCOPE_MAX] = {
};
DEFINE_STRING_TABLE_LOOKUP(runtime_scope, RuntimeScope);
+
+static const char* const runtime_scope_cmdline_option_table[_RUNTIME_SCOPE_MAX] = {
+ [RUNTIME_SCOPE_SYSTEM] = "--system",
+ [RUNTIME_SCOPE_USER] = "--user",
+ [RUNTIME_SCOPE_GLOBAL] = "--global",
+};
+
+DEFINE_STRING_TABLE_LOOKUP_TO_STRING(runtime_scope_cmdline_option, RuntimeScope);