From c69c30c8e895a26b55898b14987b9ae900069ce8 Mon Sep 17 00:00:00 2001 From: Johannes Schindelin Date: Tue, 18 May 2021 22:32:58 +0200 Subject: [PATCH] scalar: implement the `help` subcommand It is merely handing off to `git help scalar`. Signed-off-by: Johannes Schindelin --- contrib/scalar/scalar.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/contrib/scalar/scalar.c b/contrib/scalar/scalar.c index a91059c1ed983e..70a376cd7da70b 100644 --- a/contrib/scalar/scalar.c +++ b/contrib/scalar/scalar.c @@ -829,6 +829,25 @@ static int cmd_delete(int argc, const char **argv) return res; } +static int cmd_help(int argc, const char **argv) +{ + struct option options[] = { + OPT_END(), + }; + const char * const usage[] = { + N_("scalar help"), + NULL + }; + + argc = parse_options(argc, argv, NULL, options, + usage, 0); + + if (argc != 0) + usage_with_options(usage, options); + + return run_git("help", "scalar", NULL); +} + static int cmd_version(int argc, const char **argv) { int verbose = 0, build_options = 0; @@ -868,6 +887,7 @@ static struct { { "run", cmd_run }, { "reconfigure", cmd_reconfigure }, { "delete", cmd_delete }, + { "help", cmd_help }, { "version", cmd_version }, { "diagnose", cmd_diagnose }, { NULL, NULL},