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

Arthur David Olson arthurdavidolson at gmail.com
Fri Nov 9 23:10:57 UTC 2012


> 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 at 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 at codesourcery.com
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mm.icann.org/pipermail/tz/attachments/20121109/a2c0369f/attachment.html 


More information about the tz mailing list