]> git.ipfire.org Git - thirdparty/git.git/commit
builtin/notes.c: let parse-options parse subcommands
authorSZEDER Gábor <szeder.dev@gmail.com>
Fri, 19 Aug 2022 16:04:06 +0000 (18:04 +0200)
committerJunio C Hamano <gitster@pobox.com>
Fri, 19 Aug 2022 18:13:15 +0000 (11:13 -0700)
commit54ef7676bab9292c041e6ada73bb48a4c261c71b
tree3632ce686a88c1f241b8a17ec36f7368d0d6e981
parentbf0a6b65fcdb919ed27d0b77f0adfd65d84ea691
builtin/notes.c: let parse-options parse subcommands

'git notes' parses its subcommands with a long list 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 unknown subcommands, and listing subcommands for Bash
completion.  Make sure that the default operation mode doesn't accept
any arguments.

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