From 9497348a6719bacc1a0d583d396b722f0fae417e Mon Sep 17 00:00:00 2001 From: Paolo Bonzini Date: Wed, 28 Jan 2009 08:54:04 +0100 Subject: [PATCH] do not print the bug report address when --help is printed and exit status != 0 2009-01-28 Paolo Bonzini * sed/sed.c (usage): Only print the bug report address for `sed --help'. (main): Print it for `sed --version' too. * testsuite/version.gin: Adapt. * testsuite/Makefile.tests: Refine help message test. --- ChangeLog | 7 +++++++ doc/Makefile.am | 2 +- doc/sed.1 | 5 ++++- sed/sed.c | 11 ++++++++++- testsuite/Makefile.tests | 3 ++- testsuite/version.gin | 3 +++ 6 files changed, 27 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 83bc080..a11d5b3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2009-01-28 Paolo Bonzini + + * sed/sed.c (usage): Only print the bug report address for `sed --help'. + (main): Print it for `sed --version' too. + * testsuite/version.gin: Adapt. + * testsuite/Makefile.tests: Refine help message test. + 2009-01-23 Paolo Bonzini Hideo AOKI diff --git a/doc/Makefile.am b/doc/Makefile.am index cab2b22..dff687d 100644 --- a/doc/Makefile.am +++ b/doc/Makefile.am @@ -21,7 +21,7 @@ $(srcdir)/sed.texi: sed-in.texi $(srcdir)/groupify.sed sed.1: $(top_srcdir)/sed/sed.c $(top_srcdir)/configure.ac $(srcdir)/sed.x $(HELP2MAN) --name "stream editor for filtering and transforming text" \ - -p sed --include $(srcdir)/sed.x $(SED) > $(srcdir)/sed.1 + -p sed --include $(srcdir)/sed.x -o $(srcdir)/sed.1 $(SED) dist-hook: touch $(distdir)/sed.1 diff --git a/doc/sed.1 b/doc/sed.1 index 71f6a50..1e70fea 100644 --- a/doc/sed.1 +++ b/doc/sed.1 @@ -1,5 +1,5 @@ .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.28. -.TH SUPER-SED "1" "October 2006" "super-sed version 3.63" "User Commands" +.TH SUPER-SED "1" "April 2009" "super-sed version 3.63" "User Commands" .SH NAME super-sed \- stream editor for filtering and transforming text .SH SYNOPSIS @@ -376,6 +376,9 @@ Copyright \(co 2003 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, to the extent permitted by law. +.PP +E-mail bug reports to: bonzini@gnu.org . +Be sure to include the word ``sed'' somewhere in the ``Subject:'' field. .SH "SEE ALSO" .BR awk (1), .BR ed (1), diff --git a/sed/sed.c b/sed/sed.c index 9885521..fd10aaa 100644 --- a/sed/sed.c +++ b/sed/sed.c @@ -144,7 +144,11 @@ non-option argument is taken as the sed script to interpret. All\n\ remaining arguments are names of input files; if no input files are\n\ specified, then the standard input is read.\n\ \n")); - fprintf(out, _("E-mail bug reports to: %s .\n\ + + /* Only print the bug report address for `sed --help', otherwise we'll + get reports for other people's bugs. */ + if (!status) + fprintf(out, _("E-mail bug reports to: %s .\n\ Be sure to include the word ``%s'' somewhere in the ``Subject:'' field.\n"), BUG_ADDRESS, PACKAGE); @@ -306,6 +310,11 @@ This is free software; see the source for copying conditions. There is NO\n\ warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE,\n\ to the extent permitted by law.\n\ "), COPYRIGHT_NOTICE); + fputc('\n', stdout); + fprintf(stdout, _("E-mail bug reports to: %s .\n\ +Be sure to include the word ``%s'' somewhere in the ``Subject:'' field.\n"), + BUG_ADDRESS, PACKAGE); + ck_fclose (NULL); exit (0); case 'h': diff --git a/testsuite/Makefile.tests b/testsuite/Makefile.tests index c3add1d..b6d108a 100644 --- a/testsuite/Makefile.tests +++ b/testsuite/Makefile.tests @@ -113,7 +113,8 @@ binary binary2 binary3:: # help:: - $(SED) --help | $(SED) '1s/ [^ ]* / sed /' > $@.1out + $(SED) --help | grep E-mail > /dev/null 2>&1 + $(SED) --help | $(SED) '1s/ [^ ]* / sed /; /^E-mail/,$$d' > $@.1out $(SED) 2>&1 | $(SED) '1s/ [^ ]* / sed /' > $@.2out || : $(CMP) $@.1out $@.2out @$(RM) $@.1out $@.2out diff --git a/testsuite/version.gin b/testsuite/version.gin index 9774ea6..c19d974 100644 --- a/testsuite/version.gin +++ b/testsuite/version.gin @@ -5,3 +5,6 @@ Copyright (C) 2003 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, to the extent permitted by law. + +E-mail bug reports to: bonzini@gnu.org . +Be sure to include the word ``sed'' somewhere in the ``Subject:'' field.