]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
shared/options: add OPTION_COMMON_{SYSTEM,USER}
authorZbigniew Jędrzejewski-Szmek <zbyszek@amutable.com>
Tue, 12 May 2026 11:58:47 +0000 (13:58 +0200)
committerZbigniew Jędrzejewski-Szmek <zbyszek@amutable.com>
Tue, 12 May 2026 12:49:01 +0000 (14:49 +0200)
We have different help strings for --user/--system in different places, so this
only covers a subset of --system/--user instances. But this particular help
seems to be the most widely used.

(In a few cases, the help string is fixed: it should be "system mode", not
"per-system mode".)

src/import/export.c
src/import/import-fs.c
src/import/import.c
src/import/pull.c
src/shared/options.h
src/storage/storage-fs.c
src/storage/storagectl.c

index a77333643c6bc7e986a2ee5b35ffb70160dc6658..8b64b9cad901eef7523c8a2f76f4e555e9c4ab08 100644 (file)
@@ -263,11 +263,11 @@ static int parse_argv(int argc, char *argv[], char ***ret_args) {
                                 return log_error_errno(arg_class, "Failed to parse --class= argument: %s", opts.arg);
                         break;
 
-                OPTION_LONG("system", NULL, "Operate in per-system mode"):
+                OPTION_COMMON_SYSTEM:
                         arg_runtime_scope = RUNTIME_SCOPE_SYSTEM;
                         break;
 
-                OPTION_LONG("user", NULL, "Operate in per-user mode"):
+                OPTION_COMMON_USER:
                         arg_runtime_scope = RUNTIME_SCOPE_USER;
                         break;
                 }
index 513a2c62d39601c9efa9e2f18db650c13ab3215f..cc6e14c995a8a9cf3dc2e66b3dd124addc376225 100644 (file)
@@ -370,11 +370,11 @@ static int parse_argv(int argc, char *argv[], char ***ret_args) {
                                 return log_error_errno(arg_class, "Failed to parse --class= argument: %s", opts.arg);
                         break;
 
-                OPTION_LONG("system", NULL, "Operate in per-system mode"):
+                OPTION_COMMON_SYSTEM:
                         arg_runtime_scope = RUNTIME_SCOPE_SYSTEM;
                         break;
 
-                OPTION_LONG("user", NULL, "Operate in per-user mode"):
+                OPTION_COMMON_USER:
                         arg_runtime_scope = RUNTIME_SCOPE_USER;
                         break;
                 }
index 798b6b743a21cf1673c48705a1c1f1f60c18f55e..9ddc4469c1fdada2ca2825c00ebfa100dafa92f7 100644 (file)
@@ -410,11 +410,11 @@ static int parse_argv(int argc, char *argv[], char ***ret_args) {
                                 return log_error_errno(arg_class, "Failed to parse --class= argument: %s", opts.arg);
                         break;
 
-                OPTION_LONG("system", NULL, "Operate in per-system mode"):
+                OPTION_COMMON_SYSTEM:
                         arg_runtime_scope = RUNTIME_SCOPE_SYSTEM;
                         break;
 
-                OPTION_LONG("user", NULL, "Operate in per-user mode"):
+                OPTION_COMMON_USER:
                         arg_runtime_scope = RUNTIME_SCOPE_USER;
                         break;
                 }
index 6a1f913ff8a5cc3bc52e3d18ec9710c77da95149..ac9492f1775659c067440e041dc4adc1c84fbfcb 100644 (file)
@@ -537,11 +537,11 @@ static int parse_argv(int argc, char *argv[], char ***ret_args) {
                         auto_keep_download = false;
                         break;
 
-                OPTION_LONG("system", NULL, "Operate in per-system mode"):
+                OPTION_COMMON_SYSTEM:
                         arg_runtime_scope = RUNTIME_SCOPE_SYSTEM;
                         break;
 
-                OPTION_LONG("user", NULL, "Operate in per-user mode"):
+                OPTION_COMMON_USER:
                         arg_runtime_scope = RUNTIME_SCOPE_USER;
                         break;
                 }
index 1f28dab8ad51f2452f309230913a6c6dedf84405..f88275821a6e8f2443cce0190461136ea46a5140 100644 (file)
@@ -124,6 +124,12 @@ typedef struct Option {
 #define OPTION_COMMON_MACHINE                                           \
         OPTION('M', "machine", "CONTAINER", "Operate on local container")
 
+#define OPTION_COMMON_SYSTEM                                            \
+        OPTION_LONG("system", NULL, "Operate in system mode")
+
+#define OPTION_COMMON_USER                                              \
+        OPTION_LONG("user", NULL, "Operate in per-user mode")
+
 #define OPTION_COMMON_JSON                                              \
         OPTION_LONG("json", "FORMAT", "Generate JSON output (pretty, short, or off)")
 
index 167b10dd835426ac0ee18aae3e268cb42c1d0046..5b2bc415fb650c6317cf741eed7d2cab3fe36101 100644 (file)
@@ -777,11 +777,11 @@ static int parse_argv(int argc, char *argv[]) {
                 OPTION_COMMON_VERSION:
                         return version();
 
-                OPTION_LONG("system", NULL, "Operate in system mode"):
+                OPTION_COMMON_SYSTEM:
                         arg_runtime_scope = RUNTIME_SCOPE_SYSTEM;
                         break;
 
-                OPTION_LONG("user", NULL, "Operate in user mode"):
+                OPTION_COMMON_USER:
                         arg_runtime_scope = RUNTIME_SCOPE_USER;
                         break;
                 }
index bbe09e01b1d70970acedaa665e3296c7fa060e05..d3ae3f914532709b535c8be693413ed87fffa4df 100644 (file)
@@ -433,11 +433,11 @@ static int parse_argv(int argc, char *argv[], char ***args) {
                         arg_ask_password = false;
                         break;
 
-                OPTION_LONG("system", NULL, "Operate in system mode"):
+                OPTION_COMMON_SYSTEM:
                         arg_runtime_scope = RUNTIME_SCOPE_SYSTEM;
                         break;
 
-                OPTION_LONG("user", NULL, "Operate in user mode"):
+                OPTION_COMMON_USER:
                         arg_runtime_scope = RUNTIME_SCOPE_USER;
                         break;
                 }