]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
shared/options: introduce OPTION_COMMON_{ENTRY_TOKEN,MAKE_ENTRY_DIRECTORY}
authorZbigniew Jędrzejewski-Szmek <zbyszek@amutable.com>
Thu, 14 May 2026 09:51:56 +0000 (11:51 +0200)
committerZbigniew Jędrzejewski-Szmek <zbyszek@amutable.com>
Thu, 14 May 2026 11:00:11 +0000 (13:00 +0200)
src/bootctl/bootctl.c
src/shared/options.h

index 881bdfb60ffe0a0369e1952efaf03273793da72c..4bb9742a4703d257a6cae2dfe92e36921ea42870 100644 (file)
@@ -554,15 +554,13 @@ static int parse_argv(int argc, char *argv[], char ***ret_args) {
                         arg_quiet = true;
                         break;
 
-                OPTION_LONG("entry-token", "TOKEN",
-                            "Entry token to use for this installation"
-                            " (machine-id, os-id, os-image-id, auto, literal:…)"):
+                OPTION_COMMON_ENTRY_TOKEN:
                         r = parse_boot_entry_token_type(opts.arg, &arg_entry_token_type, &arg_entry_token);
                         if (r < 0)
                                 return r;
                         break;
 
-                OPTION_LONG("make-entry-directory", "yes|no|auto", "Create $BOOT/ENTRY-TOKEN/ directory"): {}
+                OPTION_COMMON_MAKE_ENTRY_DIRECTORY: {}
                 OPTION_LONG("make-machine-id-directory", "BOOL", /* help= */ NULL):  /* Compatibility alias */
                         if (streq(opts.arg, "auto"))  /* retained for backwards compatibility */
                                 arg_make_entry_directory = -1; /* yes if machine-id is permanent */
index d60c9afe81bfe57363ed71f1872cc8ef8db88a8c..5ba276eaee8d07acd2493e5245cb4db915dea46f 100644 (file)
@@ -137,6 +137,15 @@ typedef struct Option {
         OPTION_SHORT('j', NULL,                                         \
                      "Equivalent to --json=pretty (on TTY) or --json=short (otherwise)")
 
+#define OPTION_COMMON_ENTRY_TOKEN                                       \
+        OPTION_LONG("entry-token", "TOKEN",                             \
+                    "Entry token to use for this installation "         \
+                    "(machine-id, os-id, os-image-id, auto, literal:…)")
+
+#define OPTION_COMMON_MAKE_ENTRY_DIRECTORY                              \
+        OPTION_LONG("make-entry-directory",                             \
+                    "BOOL|auto", "Create $BOOT/ENTRY-TOKEN/ directory")
+
 #define OPTION_COMMON_PRIVATE_KEY(purpose)                              \
         OPTION_LONG("private-key", "PATH|URI", purpose)