This patch makes zdump and zic print their own names in their --version output, in accordance with the GNU standards
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")? --ado On Fri, Nov 9, 2012 at 4:47 PM, Joseph S. Myers <jsm@polyomino.org.uk>wrote:
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@codesourcery.com