scalar: implement the `help` subcommand

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>

Johannes Schindelin committed Sep 2, 2022 at 15:56 UTC 951759d3a5cb20ffeff4836aa0c4b793fa142b51
1 file changed +20
scalar.c
+20
@@ -819,6 +819,25 @@ static int cmd_delete(int argc, const char **argv)
819 return res;
820 }
821
822 +static int cmd_help(int argc, const char **argv)
823 +{
824 + struct option options[] = {
825 + OPT_END(),
826 + };
827 + const char * const usage[] = {
828 + "scalar help",
829 + NULL
830 + };
831 +
832 + argc = parse_options(argc, argv, NULL, options,
833 + usage, 0);
834 +
835 + if (argc != 0)
836 + usage_with_options(usage, options);
837 +
838 + return run_git("help", "scalar", NULL);
839 +}
840 +
841 static int cmd_version(int argc, const char **argv)
842 {
843 int verbose = 0, build_options = 0;
@@ -858,6 +877,7 @@ static struct {
877 { "run", cmd_run },
878 { "reconfigure", cmd_reconfigure },
879 { "delete", cmd_delete },
880 + { "help", cmd_help },
881 { "version", cmd_version },
882 { "diagnose", cmd_diagnose },
883 { NULL, NULL},