From bef3a2e28bdef09022c0baa6263a4839acc1091a Mon Sep 17 00:00:00 2001 From: Jakob Kaivo Date: Wed, 6 Mar 2019 20:07:37 -0500 Subject: add list of tests to usage output --- main.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/main.c b/main.c index bca639f..9dd5b35 100644 --- a/main.c +++ b/main.c @@ -68,9 +68,20 @@ static struct { { "wctype", test_wctype_h, 1 }, }; +void show_tests(void) +{ + size_t i; + printf("Valid tests: %s", tests[0].name); + for (i = 1; i < sizeof(tests) / sizeof(tests[0]); i++) { + printf(", %s", tests[i].name); + } + printf("\n"); +} + void usage(const char *argv0) { printf("Usage: %s [-v] [test...]\n", argv0); + show_tests(); } int main(int argc, char *argv[]) -- cgit v1.2.1