diff options
author | Mike Frysinger <vapier@gentoo.org> | 2010-09-26 14:48:51 -0400 |
---|---|---|
committer | Artem Bityutskiy <Artem.Bityutskiy@nokia.com> | 2010-09-27 09:31:10 +0300 |
commit | e960f7eb17f8d72f00364e9fc9f9a27b5563e318 (patch) | |
tree | 9c64699e742b6d220539a8827e29a662d9629fb7 /nanddump.c | |
parent | 6edaa0c971aab663cda573ded5013b3b998ee5d4 (diff) |
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 <vapier@gentoo.org>
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Diffstat (limited to 'nanddump.c')
-rw-r--r-- | nanddump.c | 21 |
1 files changed, 11 insertions, 10 deletions
@@ -13,6 +13,9 @@ * chips contained in DoC devices. */ +#define PROGRAM_NAME "nanddump" +#define VERSION "$Revision: 1.29 $" + #define _GNU_SOURCE #include <ctype.h> #include <errno.h> @@ -30,9 +33,6 @@ #include <asm/types.h> #include <mtd/mtd-user.h> -#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); } |