aboutsummaryrefslogtreecommitdiffstats
path: root/src/jailcheck
diff options
context:
space:
mode:
authorLibravatar Kelvin M. Klann <kmk3.code@protonmail.com>2023-05-11 14:36:11 -0300
committerLibravatar Kelvin M. Klann <kmk3.code@protonmail.com>2023-05-14 16:52:49 -0300
commit727da58819051dccaa6df3304042de93c6a9876d (patch)
tree956e70fe4579ea6aef7e85c0be0b8a43f6327001 /src/jailcheck
parentfirejail: simplify print_compiletime_support function (diff)
downloadfirejail-727da58819051dccaa6df3304042de93c6a9876d.tar.gz
firejail-727da58819051dccaa6df3304042de93c6a9876d.tar.zst
firejail-727da58819051dccaa6df3304042de93c6a9876d.zip
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
Diffstat (limited to 'src/jailcheck')
-rw-r--r--src/jailcheck/main.c7
1 files changed, 5 insertions, 2 deletions
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 =
36 " --help, -? - this help screen.\n" 36 " --help, -? - this help screen.\n"
37 " --version - print program version and exit.\n"; 37 " --version - print program version and exit.\n";
38 38
39static void print_version(void) {
40 printf("jailcheck version %s\n\n", VERSION);
41}
39 42
40static void usage(void) { 43static void usage(void) {
41 printf("jailcheck version %s\n\n", VERSION); 44 print_version();
42 puts(usage_str); 45 puts(usage_str);
43} 46}
44 47
@@ -62,7 +65,7 @@ int main(int argc, char **argv) {
62 return 0; 65 return 0;
63 } 66 }
64 else if (strcmp(argv[i], "--version") == 0) { 67 else if (strcmp(argv[i], "--version") == 0) {
65 printf("firetest version %s\n\n", VERSION); 68 print_version();
66 return 0; 69 return 0;
67 } 70 }
68 else if (strncmp(argv[i], "--hello=", 8) == 0) { // used by noexec test 71 else if (strncmp(argv[i], "--hello=", 8) == 0) { // used by noexec test