summaryrefslogtreecommitdiff
path: root/t/helper/test-tool.c
diff options
context:
space:
mode:
Diffstat (limited to 't/helper/test-tool.c')
-rw-r--r--t/helper/test-tool.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/t/helper/test-tool.c b/t/helper/test-tool.c
index 2a65193514..5b137874e1 100644
--- a/t/helper/test-tool.c
+++ b/t/helper/test-tool.c
@@ -48,6 +48,7 @@ static struct test_cmd cmds[] = {
{ "strcmp-offset", cmd__strcmp_offset },
{ "string-list", cmd__string_list },
{ "submodule-config", cmd__submodule_config },
+ { "submodule-nested-repo-config", cmd__submodule_nested_repo_config },
{ "subprocess", cmd__subprocess },
{ "urlmatch-normalization", cmd__urlmatch_normalization },
{ "wildmatch", cmd__wildmatch },
@@ -57,13 +58,23 @@ static struct test_cmd cmds[] = {
{ "write-cache", cmd__write_cache },
};
+static NORETURN void die_usage(void)
+{
+ size_t i;
+
+ fprintf(stderr, "usage: test-tool <toolname> [args]\n");
+ for (i = 0; i < ARRAY_SIZE(cmds); i++)
+ fprintf(stderr, " %s\n", cmds[i].name);
+ exit(128);
+}
+
int cmd_main(int argc, const char **argv)
{
int i;
BUG_exit_code = 99;
if (argc < 2)
- die("I need a test name!");
+ die_usage();
for (i = 0; i < ARRAY_SIZE(cmds); i++) {
if (!strcmp(cmds[i].name, argv[1])) {
@@ -72,5 +83,6 @@ int cmd_main(int argc, const char **argv)
return cmds[i].fn(argc, argv);
}
}
- die("There is no test named '%s'", argv[1]);
+ error("there is no tool named '%s'", argv[1]);
+ die_usage();
}