From: Zbigniew Jędrzejewski-Szmek Date: Tue, 14 Apr 2026 14:50:55 +0000 (+0200) Subject: creds: reorder option cases to match --help output X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=4356ba961f3704fa8a1b2b4ca236f4e7c2443b9a;p=thirdparty%2Fsystemd.git creds: reorder option cases to match --help output Co-developed-by: Claude Opus 4.6 --- diff --git a/src/creds/creds.c b/src/creds/creds.c index 3b1cc8e86b6..ed087d8cf1d 100644 --- a/src/creds/creds.c +++ b/src/creds/creds.c @@ -949,6 +949,34 @@ static int parse_argv(int argc, char *argv[]) { arg_pretty = true; break; + case ARG_NAME: + if (isempty(optarg)) { + arg_name = NULL; + arg_name_any = true; + break; + } + + if (!credential_name_valid(optarg)) + return log_error_errno(SYNTHETIC_ERRNO(EINVAL), "Invalid credential name: %s", optarg); + + arg_name = optarg; + arg_name_any = false; + break; + + case ARG_TIMESTAMP: + r = parse_timestamp(optarg, &arg_timestamp); + if (r < 0) + return log_error_errno(r, "Failed to parse timestamp: %s", optarg); + + break; + + case ARG_NOT_AFTER: + r = parse_timestamp(optarg, &arg_not_after); + if (r < 0) + return log_error_errno(r, "Failed to parse --not-after= timestamp: %s", optarg); + + break; + case ARG_WITH_KEY: if (streq(optarg, "help")) { if (arg_legend) @@ -1010,34 +1038,6 @@ static int parse_argv(int argc, char *argv[]) { break; - case ARG_NAME: - if (isempty(optarg)) { - arg_name = NULL; - arg_name_any = true; - break; - } - - if (!credential_name_valid(optarg)) - return log_error_errno(SYNTHETIC_ERRNO(EINVAL), "Invalid credential name: %s", optarg); - - arg_name = optarg; - arg_name_any = false; - break; - - case ARG_TIMESTAMP: - r = parse_timestamp(optarg, &arg_timestamp); - if (r < 0) - return log_error_errno(r, "Failed to parse timestamp: %s", optarg); - - break; - - case ARG_NOT_AFTER: - r = parse_timestamp(optarg, &arg_not_after); - if (r < 0) - return log_error_errno(r, "Failed to parse --not-after= timestamp: %s", optarg); - - break; - case ARG_USER: if (!uid_is_valid(arg_uid)) arg_uid = getuid();