builtin/hook.c: let parse-options parse subcommands
commitf83736ce9d3c76cd5a05d1e647cf5cf0a026f0b6
authorSZEDER Gábor <szeder.dev@gmail.com>
Fri, 19 Aug 2022 16:04:04 +0000 (19 18:04 +0200)
committerJunio C Hamano <gitster@pobox.com>
Fri, 19 Aug 2022 18:13:15 +0000 (19 11:13 -0700)
tree2f0ab8b1cb2986e3de436c03898b98f3235462ab
parent0350954482bca6accd7b4ad072a1bdb83651b376
builtin/hook.c: let parse-options parse subcommands

'git hook' parses its currently only subcommand with an if statement.
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.

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