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

Paul Eggert eggert at cs.ucla.edu
Fri Nov 9 23:44:46 UTC 2012


On 11/09/2012 03:10 PM, Arthur David Olson wrote:
> Do the GNU standards call for the canonical name (for example, "zic") or
> for the name by which the command was invoked (as derived from the arguments to "main")?

The former.  Since zic and zdump are part of a larger package,
the standards say that the output should be something like this

   zic (tz) 2012j

as in the revised patch below.  Or perhaps we should make that
string "tzcode" rather than "tz"?

Here's the chapter and verse for the coding standards:

http://www.gnu.org/prep/standards/html_node/_002d_002dversion.html

diff --git a/zdump.c b/zdump.c
index 805267d..823ffa2 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 (tz) %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..9d4c422 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 (tz) %s\n", TZVERSION);
 			exit(EXIT_SUCCESS);
 		} else if (strcmp(argv[i], "--help") == 0) {
 			usage(stdout, EXIT_SUCCESS);




More information about the tz mailing list