]> git.99rst.org Git - git.git/commitdiff
builtin/multi-pack-index.c: define common usage with a macro
authorTaylor Blau <redacted>
Tue, 30 Mar 2021 15:03:54 +0000 (11:03 -0400)
committerJunio C Hamano <redacted>
Tue, 30 Mar 2021 19:16:56 +0000 (12:16 -0700)
Factor out the usage message into pieces corresponding to each mode.
This avoids options specific to one sub-command from being shared with
another in the usage.

A subsequent commit will use these #define macros to have usage
variables for each sub-command without duplicating their contents.

Signed-off-by: Taylor Blau <redacted>
Signed-off-by: Junio C Hamano <redacted>
builtin/multi-pack-index.c

index c70f020d8f6af811b862171df91bb0a016fe1c17..eea498e02647d878a3bdf58d4f0da6ab631ee593 100644 (file)
@@ -5,8 +5,23 @@
 #include "midx.h"
 #include "trace2.h"
 
+#define BUILTIN_MIDX_WRITE_USAGE \
+       N_("git multi-pack-index [<options>] write")
+
+#define BUILTIN_MIDX_VERIFY_USAGE \
+       N_("git multi-pack-index [<options>] verify")
+
+#define BUILTIN_MIDX_EXPIRE_USAGE \
+       N_("git multi-pack-index [<options>] expire")
+
+#define BUILTIN_MIDX_REPACK_USAGE \
+       N_("git multi-pack-index [<options>] repack [--batch-size=<size>]")
+
 static char const * const builtin_multi_pack_index_usage[] = {
-       N_("git multi-pack-index [<options>] (write|verify|expire|repack --batch-size=<size>)"),
+       BUILTIN_MIDX_WRITE_USAGE,
+       BUILTIN_MIDX_VERIFY_USAGE,
+       BUILTIN_MIDX_EXPIRE_USAGE,
+       BUILTIN_MIDX_REPACK_USAGE,
        NULL
 };
 
git clone https://git.99rst.org/PROJECT