Skip to content

Commit 4be77c7

Browse files
MahiKassagitster
authored andcommitted
repo: factor repo usage strings into shared macros
Factor the "git repo info" and "git repo structure" usage strings into shared macros so they can be reused in multiple usage arrays. This is a preparatory refactoring for subsequent changes to subcommand-specific help output. Signed-off-by: Mahi Kassa <mahlet.takassa@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
1 parent ce74208 commit 4be77c7

1 file changed

Lines changed: 10 additions & 4 deletions

File tree

builtin/repo.c

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,17 @@
2020
#include "tree-walk.h"
2121
#include "utf8.h"
2222

23+
#define REPO_INFO_USAGE \
24+
"git repo info [--format=(lines|nul) | -z] [--all | <key>...]", \
25+
"git repo info --keys [--format=(lines|nul) | -z]"
26+
27+
#define REPO_STRUCTURE_USAGE \
28+
"git repo structure [--format=(table|lines|nul) | -z]"
29+
2330
static const char *const repo_usage[] = {
24-
"git repo info [--format=(lines|nul) | -z] [--all | <key>...]",
25-
"git repo info --keys [--format=(lines|nul) | -z]",
26-
"git repo structure [--format=(table|lines|nul) | -z]",
27-
NULL
31+
REPO_INFO_USAGE,
32+
REPO_STRUCTURE_USAGE,
33+
NULL,
2834
};
2935

3036
typedef int get_value_fn(struct repository *repo, struct strbuf *buf);

0 commit comments

Comments
 (0)