From: Collin Funk Date: Wed, 17 Jul 2024 02:21:51 +0000 (-0700) Subject: gitlog-to-changelog: Improve --version and --help output. X-Git-Url: https://gitweb.git.savannah.gnu.org/gitweb/?a=commitdiff_plain;h=b78892521c1aa822f109e2f7db3e8e352d10590a;p=gnulib.git gitlog-to-changelog: Improve --version and --help output. * build-aux/gitlog-to-changelog (usage): Add bug reporting address. (print_version): New function. --- diff --git a/ChangeLog b/ChangeLog index 10d712f5d2..2b9db07b47 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ 2024-07-16 Collin Funk + gitlog-to-changelog: Improve --version and --help output. + * build-aux/gitlog-to-changelog (usage): Add bug reporting address. + (print_version): New function. + announce-gen: Add bug reporting address to --help. * build-aux/announce-gen (usage): Add bug reporting address. diff --git a/build-aux/gitlog-to-changelog b/build-aux/gitlog-to-changelog index a2c348e2cf..90a53ef71e 100755 --- a/build-aux/gitlog-to-changelog +++ b/build-aux/gitlog-to-changelog @@ -35,12 +35,14 @@ eval 'exec perl -wSx "$0" "$@"' if 0; -my $VERSION = '2024-07-04 10:56'; # UTC +my $VERSION = '2024-07-17 02:20'; # UTC # The definition above must lie within the first 8 lines in order # for the Emacs time-stamp write hook (at end) to update it. # If you change this file with Emacs, please let the write hook # do its job. Otherwise, update this string manually. +(my $copyright_year = $VERSION) =~ s/^(\d*)-.*$/$1/; + use strict; use warnings; use Getopt::Long; @@ -138,11 +140,24 @@ s/all tile types/all file types/ # Change the author to be Paul. Note the escaped "@": s,Jim .*>,Paul Eggert , +Send patches and bug reports to . EOF } exit $exit_code; } +sub print_version () +{ + print "$ME version $VERSION\n"; + print "Copyright (C) $copyright_year Free Software Foundation, Inc.\n"; + print "License GPLv3+: GNU GPL version 3 or later \n" + . "This is free software: you are free to change and redistribute it.\n" + . "There is NO WARRANTY, to the extent permitted by law.\n"; + print "\n"; + my $author = "Jim Meyering"; + print "Written by $author.\n"; +} + # If the string $S is a well-behaved file name, simply return it. # If it contains white space, quotes, etc., quote it, and return the new string. sub shell_quote($) @@ -253,7 +268,7 @@ sub git_dir_option($) GetOptions ( help => sub { usage 0 }, - version => sub { print "$ME version $VERSION\n"; exit }, + version => sub { print_version; exit }, 'since=s' => \$since_date, 'until=s' => \$until_date, 'format=s' => \$format_string,