]> Savannah Git Hosting - gnulib.git/commitdiff
gitlog-to-changelog: Improve --version and --help output.
authorCollin Funk <collin.funk1@gmail.com>
Wed, 17 Jul 2024 02:21:51 +0000 (19:21 -0700)
committerCollin Funk <collin.funk1@gmail.com>
Wed, 17 Jul 2024 02:21:51 +0000 (19:21 -0700)
* build-aux/gitlog-to-changelog (usage): Add bug reporting address.
(print_version): New function.

ChangeLog
build-aux/gitlog-to-changelog

index 10d712f5d2064d3fb4ae46a422929ff96aa8691b..2b9db07b473f35a5a94ee10a02313b0a758f1a79 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
 2024-07-16  Collin Funk  <collin.funk1@gmail.com>
 
+       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.
 
index a2c348e2cf07d99a24b4cce86fe26ea9353935f8..90a53ef71edb2a888904b556b9a137c2d6dcc3ab 100755 (executable)
 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 <eggert\\\@cs.ucla.edu>,
 
+Send patches and bug reports to <bug-gnulib\@gnu.org>.
 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 <https://gnu.org/licenses/gpl.html>\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,