]> git.ipfire.org Git - thirdparty/git.git/commitdiff
scalar: implement the `help` subcommand
authorJohannes Schindelin <johannes.schindelin@gmx.de>
Fri, 2 Sep 2022 15:56:45 +0000 (15:56 +0000)
committerJunio C Hamano <gitster@pobox.com>
Fri, 2 Sep 2022 17:02:56 +0000 (10:02 -0700)
It is merely handing off to `git help scalar`.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Victoria Dye <vdye@github.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
scalar.c

index 642d16124eb20c28de20e8601e99f1b347c7fa75..c5c1ce689199083a9eb47ff6161ce6b1bcd7be64 100644 (file)
--- a/scalar.c
+++ b/scalar.c
@@ -819,6 +819,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[] = {
+               "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;
@@ -858,6 +877,7 @@ static struct {
        { "run", cmd_run },
        { "reconfigure", cmd_reconfigure },
        { "delete", cmd_delete },
+       { "help", cmd_help },
        { "version", cmd_version },
        { "diagnose", cmd_diagnose },
        { NULL, NULL},