From e960f7eb17f8d72f00364e9fc9f9a27b5563e318 Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Sun, 26 Sep 2010 14:48:51 -0400 Subject: mtd-utils: standardize PROGRAM_NAME Make sure all the utils define PROGRAM_NAME and do so at the start of the file so that sub-headers may assume it exists. Signed-off-by: Mike Frysinger Signed-off-by: Artem Bityutskiy --- rfdformat.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'rfdformat.c') diff --git a/rfdformat.c b/rfdformat.c index d2637a1..17d9d2d 100644 --- a/rfdformat.c +++ b/rfdformat.c @@ -12,6 +12,9 @@ * the beginning of each block. */ +#define PROGRAM_NAME "rfdformat" +#define VERSION "$Revision 1.0 $" + #define _XOPEN_SOURCE 500 /* For pread/pwrite */ #include @@ -26,25 +29,24 @@ #include #include -#define PROGRAM "rfdformat" -#define VERSION "$Revision 1.0 $" - void display_help(void) { - printf("Usage: " PROGRAM " [OPTIONS] MTD-device\n" + printf("Usage: %s [OPTIONS] MTD-device\n" "Formats NOR flash for resident flash disk\n" "\n" "-h --help display this help and exit\n" - "-V --version output version information and exit\n"); + "-V --version output version information and exit\n", + PROGRAM_NAME); exit(0); } void display_version(void) { - printf(PROGRAM " " VERSION "\n" + printf("%s " VERSION "\n" "\n" "This is free software; see the source for copying conditions. There is NO\n" - "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n"); + "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n", + PROGRAM_NAME); exit(0); } -- cgit v1.2.3