From: Zbigniew Jędrzejewski-Szmek Date: Thu, 14 May 2026 09:51:56 +0000 (+0200) Subject: shared/options: introduce OPTION_COMMON_{ENTRY_TOKEN,MAKE_ENTRY_DIRECTORY} X-Git-Tag: v261-rc1~169^2~5 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=92fbc11f6af9ed15ebc0ba8f8e308ac6113db0da;p=thirdparty%2Fsystemd.git shared/options: introduce OPTION_COMMON_{ENTRY_TOKEN,MAKE_ENTRY_DIRECTORY} --- diff --git a/src/bootctl/bootctl.c b/src/bootctl/bootctl.c index 881bdfb60ff..4bb9742a470 100644 --- a/src/bootctl/bootctl.c +++ b/src/bootctl/bootctl.c @@ -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 */ diff --git a/src/shared/options.h b/src/shared/options.h index d60c9afe81b..5ba276eaee8 100644 --- a/src/shared/options.h +++ b/src/shared/options.h @@ -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)