diff options
| author | Lucas Seiki Oshiro <lucasseikioshiro@gmail.com> | 2025-12-04 17:10:12 -0300 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2025-12-05 11:39:19 +0900 |
| commit | 76c0704bdf6ee8ac0be11830cb6ae8d08cc587a8 (patch) | |
| tree | 13d438af035169365e285d3779e846e79e11e8d5 /builtin/repo.c | |
| parent | 768cf991ffea54dbcaf63c45750f0e3a26ebdcc6 (diff) | |
| download | git-76c0704bdf6ee8ac0be11830cb6ae8d08cc587a8.tar.gz | |
repo: add -z as an alias for --format=nul to git-repo-structure
Other Git commands that have nul-terminated output, such as git-config,
git-status, git-ls-files, and git-repo-info have a flag `-z` for using
the null character as the record separator.
Add the `-z` flag to git-repo-structure as an alias for `--format=nul`,
making it consistent with the behavior of the other commands.
Signed-off-by: Lucas Seiki Oshiro <lucasseikioshiro@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/repo.c')
| -rw-r--r-- | builtin/repo.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/builtin/repo.c b/builtin/repo.c index cc97dd1836..0dd41b1778 100644 --- a/builtin/repo.c +++ b/builtin/repo.c @@ -16,7 +16,7 @@ static const char *const repo_usage[] = { "git repo info [--format=(keyvalue|nul) | -z] [--all | <key>...]", - "git repo structure [--format=(table|keyvalue|nul)]", + "git repo structure [--format=(table|keyvalue|nul) | -z]", NULL }; @@ -529,6 +529,10 @@ static int cmd_repo_structure(int argc, const char **argv, const char *prefix, OPT_CALLBACK_F(0, "format", &format, N_("format"), N_("output format"), PARSE_OPT_NONEG, parse_format_cb), + OPT_CALLBACK_F('z', NULL, &format, NULL, + N_("synonym for --format=nul"), + PARSE_OPT_NONEG | PARSE_OPT_NOARG, + parse_format_cb), OPT_BOOL(0, "progress", &show_progress, N_("show progress")), OPT_END() }; |
