Re: [PATCH 1/5] commit-graph: define common usage with a macro

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 2/15/2021 1:41 PM, Ævar Arnfjörð Bjarmason wrote:
> +static const char * builtin_commit_graph_verify_usage[] = {
> +#define BUILTIN_COMMIT_GRAPH_VERIFY_USAGE \
> +	N_("git commit-graph verify [--object-dir <objdir>] [--shallow] [--[no-]progress]")
> +	BUILTIN_COMMIT_GRAPH_VERIFY_USAGE,
>  	NULL
>  };
>  
> +static const char * builtin_commit_graph_write_usage[] = {
> +#define BUILTIN_COMMIT_GRAPH_WRITE_USAGE \
> +	N_("git commit-graph write [--object-dir <objdir>] [--append] " \
> +	   "[--split[=<strategy>]] [--reachable|--stdin-packs|--stdin-commits] " \
> +	   "[--changed-paths] [--[no-]max-new-filters <n>] [--[no-]progress] " \
> +	   "<split options>")
> +	BUILTIN_COMMIT_GRAPH_WRITE_USAGE,
>  	NULL
>  };

This seemed very unnatural to me, but it all makes sense in the end:

> +static char const * const builtin_commit_graph_usage[] = {
> +	BUILTIN_COMMIT_GRAPH_VERIFY_USAGE,
> +	BUILTIN_COMMIT_GRAPH_WRITE_USAGE,
> +	NULL,
>  };

Clever!

Thanks,
-Stolee



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux