NULL,
};
+static const char *const repo_info_usage[] = {
+ REPO_INFO_USAGE,
+ NULL,
+};
+
+static const char *const repo_structure_usage[] = {
+ REPO_STRUCTURE_USAGE,
+ NULL,
+};
+
typedef int get_value_fn(struct repository *repo, struct strbuf *buf);
enum output_format {
OPT_END()
};
- argc = parse_options(argc, argv, prefix, options, repo_usage, 0);
+ argc = parse_options(argc, argv, prefix, options, repo_info_usage, 0);
if (show_keys && (all_keys || argc))
die(_("--keys cannot be used with a <key> or --all"));
OPT_END()
};
- argc = parse_options(argc, argv, prefix, options, repo_usage, 0);
+ argc = parse_options(argc, argv, prefix, options, repo_structure_usage, 0);
if (argc)
usage(_("too many arguments"));
test_cmp expect actual
'
+test_expect_success 'git repo info -h shows only repo info usage' '
+ test_must_fail git repo info -h >actual &&
+ test_grep "git repo info" actual &&
+ test_grep ! "git repo structure" actual
+'
+
test_done
)
'
+test_expect_success 'git repo structure -h shows only repo structure usage' '
+ test_must_fail git repo structure -h >actual &&
+ test_grep "git repo structure" actual &&
+ test_grep ! "git repo info" actual
+'
+
test_done