From 0d3e045b34f38d23e6160ce8aae363f358bd5cdc Mon Sep 17 00:00:00 2001 From: René Scharfe Date: Wed, 9 Jul 2025 11:45:14 +0200 Subject: parse-options: add precision handling for PARSE_OPT_CMDMODE MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Build on 09705696f7 (parse-options: introduce precision handling for `OPTION_INTEGER`, 2025-04-17) to support value variables of different sizes for PARSE_OPT_CMDMODE options. Do that by requiring their "precision" to be set and casting their "value" pointer accordingly. Call the function that does the raw casting do_get_int_value() to reserve the name get_int_value() for a more friendly wrapper we're going to introduce in one of the next patches. Signed-off-by: René Scharfe Signed-off-by: Junio C Hamano --- builtin/am.c | 1 + 1 file changed, 1 insertion(+) (limited to 'builtin') diff --git a/builtin/am.c b/builtin/am.c index e32a3b4c97..ce58abf2a2 100644 --- a/builtin/am.c +++ b/builtin/am.c @@ -2406,6 +2406,7 @@ int cmd_am(int argc, .type = OPTION_CALLBACK, .long_name = "show-current-patch", .value = &resume_mode, + .precision = sizeof(resume_mode), .argh = "(diff|raw)", .help = N_("show the patch being applied"), .flags = PARSE_OPT_CMDMODE | PARSE_OPT_OPTARG | PARSE_OPT_NONEG | PARSE_OPT_LITERAL_ARGHELP, -- cgit v1.3