aboutsummaryrefslogtreecommitdiff
path: root/tests/fs-tests/integrity
diff options
context:
space:
mode:
authorDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2016-07-19 15:06:58 +0200
committerDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2016-11-17 11:36:55 +0100
commit7dd42c510dc8ab10f52dcc2d20dc8af412be0744 (patch)
treefa45022d4754db6a72285d7e9f9284e877ce06c5 /tests/fs-tests/integrity
parent8a00021b2ab5529640e5acaca30a27cdaca04178 (diff)
Unify version string printing
When a program does sophisticated enough command line processing (i.e. getopt), make sure it responds to -V and --version. When a program prints a version string, make sure it uses the common_print_version macro to print out its name, that it is part of mtd-utils and the mtd-utils version from the build system in a fashion similar to common program packages like the GNU coreutils. When a program responds to -V/--version or -h/--help, make sure it reports success exit status. Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at> Signed-off-by: Richard Weinberger <richard@nod.at>
Diffstat (limited to 'tests/fs-tests/integrity')
-rw-r--r--tests/fs-tests/integrity/integck.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/tests/fs-tests/integrity/integck.c b/tests/fs-tests/integrity/integck.c
index c6319fb..67384fa 100644
--- a/tests/fs-tests/integrity/integck.c
+++ b/tests/fs-tests/integrity/integck.c
@@ -37,7 +37,6 @@
#include <sys/mount.h>
#include <sys/statvfs.h>
-#define PROGRAM_VERSION "1.1"
#define PROGRAM_NAME "integck"
#include "common.h"
#include "libubi.h"
@@ -2992,7 +2991,7 @@ static void get_tested_fs_info(void)
pid, fsinfo.fstype, fsinfo.mount_point);
}
-static const char doc[] = PROGRAM_NAME " version " PROGRAM_VERSION
+static const char doc[] = PROGRAM_NAME " version " VERSION
" - a stress test which checks the file-system integrity.\n"
"\n"
"The test creates a directory named \"integck_test_dir_<pid>\", where where\n"
@@ -3077,7 +3076,7 @@ static int parse_opts(int argc, char * const argv[])
args.verbose = 1;
break;
case 'V':
- fprintf(stderr, "%s\n", PROGRAM_VERSION);
+ common_print_version();
exit(EXIT_SUCCESS);
case 'h':