summaryrefslogtreecommitdiff
path: root/jffsX-utils/mkfs.jffs2.c
diff options
context:
space:
mode:
authorDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2016-07-19 15:06:58 +0200
committerDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2016-11-17 11:36:55 +0100
commit7dd42c510dc8ab10f52dcc2d20dc8af412be0744 (patch)
treefa45022d4754db6a72285d7e9f9284e877ce06c5 /jffsX-utils/mkfs.jffs2.c
parent8a00021b2ab5529640e5acaca30a27cdaca04178 (diff)
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 <david.oberhollenzer@sigma-star.at> Signed-off-by: Richard Weinberger <richard@nod.at>
Diffstat (limited to 'jffsX-utils/mkfs.jffs2.c')
-rw-r--r--jffsX-utils/mkfs.jffs2.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/jffsX-utils/mkfs.jffs2.c b/jffsX-utils/mkfs.jffs2.c
index b83c1ee..5446a16 100644
--- a/jffsX-utils/mkfs.jffs2.c
+++ b/jffsX-utils/mkfs.jffs2.c
@@ -1427,8 +1427,6 @@ static const char helptext[] =
" -V, --version Display version information\n"
" -i, --incremental=FILE Parse FILE and generate appendage output for it\n\n";
-static const char revtext[] = "1.60";
-
int load_next_block() {
int ret;
@@ -1631,14 +1629,16 @@ int main(int argc, char **argv)
case 'h':
case '?':
- errmsg_die("%s", helptext);
+ puts(helptext);
+ exit(EXIT_SUCCESS);
case 'v':
verbose = 1;
break;
case 'V':
- errmsg_die("revision %s\n", revtext);
+ common_print_version();
+ exit(EXIT_SUCCESS);
case 'e': {
char *next;