From 7dd42c510dc8ab10f52dcc2d20dc8af412be0744 Mon Sep 17 00:00:00 2001 From: David Oberhollenzer Date: Tue, 19 Jul 2016 15:06:58 +0200 Subject: 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 Signed-off-by: Richard Weinberger --- include/common.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/common.h b/include/common.h index bf1ade9..11e1989 100644 --- a/include/common.h +++ b/include/common.h @@ -215,7 +215,7 @@ simple_strtoX(strtoull, unsigned long long int) /* Simple version-printing for utils */ #define common_print_version() \ do { \ - printf("%s %s\n", PROGRAM_NAME, VERSION); \ + printf("%s (mtd-utils) %s\n", PROGRAM_NAME, VERSION); \ } while (0) #include "xalloc.h" -- cgit v1.2.3