Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSZEDER Gábor <szeder.dev@gmail.com>2022-08-19 19:04:08 +0300
committerJunio C Hamano <gitster@pobox.com>2022-08-19 21:13:16 +0300
commitb26a412f1e96e40c419001991486cced837679a6 (patch)
tree23f58d32b34c70fc13792f3035e86f45b68649fe /builtin/sparse-checkout.c
parent729b97332b05564133e4039fbab9f694c25097a2 (diff)
builtin/remote.c: let parse-options parse subcommands
'git remote' 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; and while at it remove the capitalization of the error message and adjust the test checking it accordingly. Note that 'git remote' has both 'remove' and 'rm' subcommands, and the former is preferred [1], so hide the latter for completion. Note also 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 a bunch of function pointers. [1] e17dba8fe1 (remote: prefer subcommand name 'remove' to 'rm', 2012-09-06) Signed-off-by: SZEDER Gábor <szeder.dev@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/sparse-checkout.c')
0 files changed, 0 insertions, 0 deletions