parse-options: factor out register_abbrev() and struct parsed_option
commitcb46c3faf843fa46ce2df22baeb02ad2f60da6fb
authorRené Scharfe <l.s.r@web.de>
Sun, 3 Mar 2024 12:19:40 +0000 (3 13:19 +0100)
committerJunio C Hamano <gitster@pobox.com>
Sun, 3 Mar 2024 17:49:21 +0000 (3 09:49 -0800)
tree912a6e621ed34299fac46969ece14034e1555091
parent597f9d037df56334b9dc938ffcfeb9a879f80a7c
parse-options: factor out register_abbrev() and struct parsed_option

Add a function, register_abbrev(), for storing the necessary details for
remembering an abbreviated and thus potentially ambiguous option.  Call
it instead of sharing the code using goto, to make the control flow more
explicit.

Conveniently collect these details in the new struct parsed_option to
reduce the number of necessary function arguments.

Signed-off-by: René Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
parse-options.c