From a7583042a5e5137d0d91ecf7f0e33118273a5d2e Mon Sep 17 00:00:00 2001
From: Akim Demaille <akim@lrde.epita.fr>
Date: Wed, 23 May 2012 09:45:14 +0200
Subject: [PATCH 1/3] announce-gen: Improve diagnostics.

* build-aux/announce-gen: When parsing command line options,
prefer "announce-gen: option --release-type requires an argument"
to "Option release-type requires an argument".
---
 build-aux/announce-gen |   10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/build-aux/announce-gen b/build-aux/announce-gen
index 8c6ed36..c5bb94a 100755
--- a/build-aux/announce-gen
+++ b/build-aux/announce-gen
@@ -3,7 +3,7 @@ eval '(exit $?0)' && eval 'exec perl -wS "$0" ${1+"$@"}'
     if 0;
 # Generate a release announcement message.
 
-my $VERSION = '2012-04-19 14:36'; # UTC
+my $VERSION = '2012-05-23 07:44'; # 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
@@ -369,6 +369,12 @@ sub get_tool_versions ($$)
   my $gnulib_version;
   my $print_checksums_p = 1;
 
+  local $SIG{__WARN__} = sub
+    {
+      my ($msg) = @_;
+      $msg =~ s/Option (\w)/option --$1/;
+      warn "$ME: $msg";
+    };
   GetOptions
     (
      'mail-headers=s'     => \$mail_headers,
@@ -389,7 +395,7 @@ sub get_tool_versions ($$)
     ) or usage 1;
 
   my $fail = 0;
-  # Ensure that sure each required option is specified.
+  # Ensure that each required option is specified.
   $release_type
     or (warn "$ME: release type not specified\n"), $fail = 1;
   $package_name
-- 
1.7.10.2

