From 727da58819051dccaa6df3304042de93c6a9876d Mon Sep 17 00:00:00 2001 From: "Kelvin M. Klann" Date: Thu, 11 May 2023 14:36:11 -0300 Subject: Standardize version output Changes: * Only print the version line in the print_version function * Add a print_version function where missing (put it in usage.c if the file exists) * Always a blank line after the version --- src/jailcheck/main.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/jailcheck') diff --git a/src/jailcheck/main.c b/src/jailcheck/main.c index e01f1ca4e..e30ffb274 100644 --- a/src/jailcheck/main.c +++ b/src/jailcheck/main.c @@ -36,9 +36,12 @@ static char *usage_str = " --help, -? - this help screen.\n" " --version - print program version and exit.\n"; +static void print_version(void) { + printf("jailcheck version %s\n\n", VERSION); +} static void usage(void) { - printf("jailcheck version %s\n\n", VERSION); + print_version(); puts(usage_str); } @@ -62,7 +65,7 @@ int main(int argc, char **argv) { return 0; } else if (strcmp(argv[i], "--version") == 0) { - printf("firetest version %s\n\n", VERSION); + print_version(); return 0; } else if (strncmp(argv[i], "--hello=", 8) == 0) { // used by noexec test -- cgit v1.2.3-54-g00ecf