[tz] Print zdump and zic program names in --version output

Joseph S. Myers jsm at polyomino.org.uk
Fri Nov 9 21:47:54 UTC 2012


This patch makes zdump and zic print their own names in their --version 
output, in accordance with the GNU standards for what --version should 
print.  (tzselect already does print its name in --version output.)

diff --git a/zdump.c b/zdump.c
index 805267d..8b118ed 100644
--- a/zdump.c
+++ b/zdump.c
@@ -309,7 +309,7 @@ main(int argc, char *argv[])
 	progname = argv[0];
 	for (i = 1; i < argc; ++i)
 		if (strcmp(argv[i], "--version") == 0) {
-			(void) printf("%s\n", TZVERSION);
+			(void) printf("zdump %s\n", TZVERSION);
 			exit(EXIT_SUCCESS);
 		} else if (strcmp(argv[i], "--help") == 0) {
 			usage(stdout, EXIT_SUCCESS);
diff --git a/zic.c b/zic.c
index a9a54bb..428eaaa 100644
--- a/zic.c
+++ b/zic.c
@@ -462,7 +462,7 @@ main(int argc, char **argv)
 	}
 	for (i = 1; i < argc; ++i)
 		if (strcmp(argv[i], "--version") == 0) {
-			(void) printf("%s\n", TZVERSION);
+			(void) printf("zic %s\n", TZVERSION);
 			exit(EXIT_SUCCESS);
 		} else if (strcmp(argv[i], "--help") == 0) {
 			usage(stdout, EXIT_SUCCESS);

-- 
Joseph S. Myers
joseph at codesourcery.com



More information about the tz mailing list