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 --- nanddump.c | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) (limited to 'nanddump.c') diff --git a/nanddump.c b/nanddump.c index 709b2db..3589931 100644 --- a/nanddump.c +++ b/nanddump.c @@ -13,6 +13,9 @@ * chips contained in DoC devices. */ +#define PROGRAM_NAME "nanddump" +#define VERSION "$Revision: 1.29 $" + #define _GNU_SOURCE #include #include @@ -30,9 +33,6 @@ #include #include -#define PROGRAM "nanddump" -#define VERSION "$Revision: 1.29 $" - static struct nand_oobinfo none_oobinfo = { .useecc = MTD_NANDECC_OFF, }; @@ -40,7 +40,7 @@ static struct nand_oobinfo none_oobinfo = { static void display_help (void) { printf( -"Usage: nanddump [OPTIONS] MTD-device\n" +"Usage: %s [OPTIONS] MTD-device\n" "Dumps the contents of a nand mtd partition.\n" "\n" " --help Display this help and exit\n" @@ -55,21 +55,22 @@ static void display_help (void) "-b --omitbad Omit bad blocks from the dump\n" "-p --prettyprint Print nice (hexdump)\n" "-q --quiet Don't display progress and status messages\n" -"-s addr --startaddress=addr Start address\n" - ); +"-s addr --startaddress=addr Start address\n", + PROGRAM_NAME); exit(EXIT_SUCCESS); } static void display_version (void) { - printf(PROGRAM " " VERSION "\n" + printf("%1$s " VERSION "\n" "\n" - PROGRAM " comes with NO WARRANTY\n" + "%1$s comes with NO WARRANTY\n" "to the extent permitted by law.\n" "\n" - "You may redistribute copies of " PROGRAM "\n" + "You may redistribute copies of %1$s\n" "under the terms of the GNU General Public Licence.\n" - "See the file `COPYING' for more information.\n"); + "See the file `COPYING' for more information.\n", + PROGRAM_NAME); exit(EXIT_SUCCESS); } -- cgit v1.2.3