useless-if-before-free: Implement --version option according to GCS.
authorBruno Haible <bruno@clisp.org>
Sun, 11 Apr 2021 12:30:03 +0000 (14:30 +0200)
committerBruno Haible <bruno@clisp.org>
Sun, 11 Apr 2021 12:30:03 +0000 (14:30 +0200)
* build-aux/useless-if-before-free (copyright_year): New variable.
(GetOptions): Print also a short copyright and license notice and
author statement.

ChangeLog
build-aux/useless-if-before-free

index 1006e25047d194422987819da73334b0534f9b4c..b046ab72ab8d85322971b2a4b191f9dabd303f9c 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
 2021-04-11  Bruno Haible  <bruno@clisp.org>
 
+       useless-if-before-free: Implement --version option according to GCS.
+       * build-aux/useless-if-before-free (copyright_year): New variable.
+       (GetOptions): Print also a short copyright and license notice and
+       author statement.
+
        libtool-next-version: Implement --version option according to GCS.
        * build-aux/libtool-next-version (scriptversion): New variable.
        (func_version): Deduce the copyright year from it. Terminate sentences
index 784d80b3e7bc5e4e4dd20199927c6e69a954028d..5bbbc44c52d5b31d57d401eecfc3b6c5a64dacef 100755 (executable)
 eval 'exec perl -wSx "$0" "$@"'
      if 0;
 
-my $VERSION = '2020-04-04 15:07'; # UTC
+my $VERSION = '2021-04-11 10:11'; # 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 = '2021';
+
 use strict;
 use warnings;
 use Getopt::Long;
@@ -118,7 +120,19 @@ sub is_NULL ($)
   GetOptions
     (
      help => sub { usage 0 },
-     version => sub { print "$ME version $VERSION\n"; exit },
+     version =>
+       sub
+       {
+         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";
+         exit
+       },
      list => \$list,
      'name=s@' => \@name,
     ) or usage 1;