summaryrefslogtreecommitdiffstats
path: root/text-utils/pg.c
diff options
context:
space:
mode:
authorSami Kerola2012-03-17 21:28:33 +0100
committerKarel Zak2012-03-30 16:48:12 +0200
commitb6415f124340eb64d6116ac40c5d1e0a632424e9 (patch)
treee0552501fe3c3916ba23fa6e04969bbab6db4075 /text-utils/pg.c
parentraw: clean up coding style (diff)
downloadkernel-qcow2-util-linux-b6415f124340eb64d6116ac40c5d1e0a632424e9.tar.gz
kernel-qcow2-util-linux-b6415f124340eb64d6116ac40c5d1e0a632424e9.tar.xz
kernel-qcow2-util-linux-b6415f124340eb64d6116ac40c5d1e0a632424e9.zip
pg: correct version printing in help screen
Commit also adds -V option. Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Diffstat (limited to 'text-utils/pg.c')
-rw-r--r--text-utils/pg.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/text-utils/pg.c b/text-utils/pg.c
index 84bb9fb2a..365365575 100644
--- a/text-utils/pg.c
+++ b/text-utils/pg.c
@@ -142,9 +142,8 @@ jmp_buf jmpenv; /* jump from signal handlers */
int canjump; /* jmpenv is valid */
wchar_t wbuf[READBUF]; /* used in several widechar routines */
-const char *copyright =
-"@(#)pg 1.44 2/8/02. Copyright (c) 2000-2001 Gunnar Ritter. ";
-const char *helpscreen = N_("All rights reserved.\n\
+char *copyright;
+const char *helpscreen = N_("\
-------------------------------------------------------\n\
h this screen\n\
q or Q quit program\n\
@@ -1500,7 +1499,7 @@ found_bw:
* Help!
*/
const char *help = _(helpscreen);
- write_all(1, copyright + 4, strlen(copyright + 4));
+ write_all(1, copyright, strlen(copyright));
write_all(1, help, strlen(help));
goto newcmd;
}
@@ -1574,6 +1573,9 @@ main(int argc, char **argv)
FILE *input;
progname = basename(argv[0]);
+ xasprintf(&copyright,
+ _("%s %s Copyright (c) 2000-2001 Gunnar Ritter. All rights reserved.\n"),
+ program_invocation_short_name, PACKAGE_VERSION);
setlocale(LC_MESSAGES, "");
bindtextdomain(PACKAGE, LOCALEDIR);
@@ -1635,6 +1637,9 @@ main(int argc, char **argv)
case 's':
sflag = 1;
break;
+ case 'V':
+ printf(UTIL_LINUX_VERSION);
+ return EXIT_SUCCESS;
default:
invopt(&argv[arg][i]);
}