]> git.ipfire.org Git - thirdparty/git.git/commit
parseopt: autocorrect mistyped subcommands
authorJiamu Sun <39@barroit.sh>
Thu, 23 Apr 2026 01:37:57 +0000 (10:37 +0900)
committerJunio C Hamano <gitster@pobox.com>
Thu, 23 Apr 2026 02:02:28 +0000 (11:02 +0900)
commitb9e6a2d30afc65eaf8b5002fa8e098d789291975
treebe059bb20fef9ac0fa9e2332ab8f881402f61f7f
parent0df5897d286706992a48ccbffa0ce6acf2cbca8b
parseopt: autocorrect mistyped subcommands

Try to autocorrect the mistyped mandatory subcommand before showing an
error and exiting. Subcommands parsed with PARSE_OPT_SUBCOMMAND_OPTIONAL
are skipped.

The subcommand autocorrection behaves the same as the command
autocorrection.

Signed-off-by: Jiamu Sun <39@barroit.sh>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
autocorrect.h
help.c
parse-options.c
t/t0040-parse-options.sh
t/t7900-maintenance.sh