builtin/multi-pack-index.c: let parse-options parse subcommands
commitbf0a6b65fcdb919ed27d0b77f0adfd65d84ea691
authorSZEDER Gábor <szeder.dev@gmail.com>
Fri, 19 Aug 2022 16:04:05 +0000 (19 18:04 +0200)
committerJunio C Hamano <gitster@pobox.com>
Fri, 19 Aug 2022 18:13:15 +0000 (19 11:13 -0700)
tree14c0762d0e3212b421317fd0b395c031f042cce6
parentf83736ce9d3c76cd5a05d1e647cf5cf0a026f0b6
builtin/multi-pack-index.c: let parse-options parse subcommands

'git multi-pack-index' parses its subcommands with a couple of if-else
if statements.  parse-options has just learned to parse subcommands,
so let's use that facility instead, with the benefits of shorter code,
handling missing or unknown subcommands, and listing subcommands for
Bash completion.

Note that the functions implementing each subcommand only accept the
'argc' and '**argv' parameters, so add a (unused) '*prefix' parameter
to make them match the type expected by parse-options, and thus avoid
casting function pointers.

Signed-off-by: SZEDER Gábor <szeder.dev@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/multi-pack-index.c