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 --- tests/jittertest/plotJittervsFill.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'tests/jittertest/plotJittervsFill.c') diff --git a/tests/jittertest/plotJittervsFill.c b/tests/jittertest/plotJittervsFill.c index 99e627b..f9427f1 100644 --- a/tests/jittertest/plotJittervsFill.c +++ b/tests/jittertest/plotJittervsFill.c @@ -62,7 +62,9 @@ #include #include -static char Version_string[] = "$Id: plotJittervsFill.c,v 1.6 2005/11/07 11:15:21 gleixner Exp $"; +#define PROGRAM_NAME "plotJittervsFill" +#include "common.h" + static char LogFile[250] = "InputLogFile.log"; static int JitterThreshold_ms = 1000; @@ -103,7 +105,7 @@ void HandleCmdLineArgs( if ((strcmp(argv[argNum],"--version") == 0) || (strcmp(argv[argNum],"-v") == 0)) { /* Print version information and exit. */ - printf("%s\n", Version_string); + common_print_version(); exit(0); } -- cgit v1.2.3