From 40805f75c6146e8c5f9ce1f61774ea00ae01c573 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".
---
 ChangeLog              |    7 +++++++
 build-aux/announce-gen |   10 ++++++++--
 2 files changed, 15 insertions(+), 2 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index e00c8bb..12a8cbe 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2012-05-23  Akim Demaille  <akim@lrde.epita.fr>
+
+	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".
+
 2012-05-15  Akim Demaille  <akim@lrde.epita.fr>
 
 	gitlog-to-changelog: support the log message format used in Bison.
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

