--------
[synopsis]
git repo info [--format=(keyvalue|nul) | -z] [--all | <key>...]
-git repo structure [--format=(table|keyvalue|nul)]
+git repo structure [--format=(table|keyvalue|nul) | -z]
DESCRIPTION
-----------
+
`-z` is an alias for `--format=nul`.
-`structure [--format=(table|keyvalue|nul)]`::
+`structure [--format=(table|keyvalue|nul) | -z]`::
Retrieve statistics about the current repository structure. The
following kinds of information are reported:
+
the delimiter between the key and value instead of '='. Unlike the
`keyvalue` format, values containing "unusual" characters are never
quoted.
++
+`-z` is an alias for `--format=nul`.
INFO KEYS
---------
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
};
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()
};
tr "\n=" "\0\n" <expect >expect_nul &&
git repo structure --format=nul >out 2>err &&
+ test_cmp expect_nul out &&
+ test_line_count = 0 err &&
+
+ # "-z", as a synonym to "--format=nul", participates in the
+ # usual "last one wins" rule.
+ git repo structure --format=table -z >out 2>err &&
+
test_cmp expect_nul out &&
test_line_count = 0 err
)