Re: [PATCH 4/8] scalar: implement the `help` subcommand
- From
Johannes Schindelin <johannes.schindelin@gmx.de>
- Date
- Sep 1, 2022, 08:51 UTC
- Message-ID
- <5q412o8n-60so-52qn-883q-s3spo168o7r9@tzk.qr>
- In-Reply-To
- <46d0fddfe8fbc2c568cb5a3d14594276db2bc1a9.1661961746.git.gitgitgadget@gmail.com>
Hi Victoria,
On Wed, 31 Aug 2022, Johannes Schindelin via GitGitGadget wrote:
> From: Johannes Schindelin <johasc@microsoft.com>
I probably left that in by mistake. Could I bother you to change this (and the corresponding Signed-off-by: footer) to use my usual email address?
Thank you, Dscho
Show 51 quoted lines
>
> It is merely handing off to `git help scalar`.
>
> Signed-off-by: Johannes Schindelin <johasc@microsoft.com>
> Signed-off-by: Victoria Dye <vdye@github.com>
> ---
> scalar.c | 20 ++++++++++++++++++++
> 1 file changed, 20 insertions(+)
>
> diff --git a/scalar.c b/scalar.c
> index 642d16124eb..675d7a6b0a9 100644
> --- 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[] = {
> + 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;
> @@ -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},
> --
> gitgitgadget
>
>