NetBSD Problem Report #46103

From www@NetBSD.org  Sun Feb 26 20:53:34 2012
Return-Path: <www@NetBSD.org>
Received: from mail.netbsd.org (mail.netbsd.org [149.20.53.66])
	by www.NetBSD.org (Postfix) with ESMTP id 453C363E12B
	for <gnats-bugs@gnats.NetBSD.org>; Sun, 26 Feb 2012 20:53:34 +0000 (UTC)
Message-Id: <20120226205333.4129963E124@www.NetBSD.org>
Date: Sun, 26 Feb 2012 20:53:33 +0000 (UTC)
From: bughunting@xs4all.nl
Reply-To: bughunting@xs4all.nl
To: gnats-bugs@NetBSD.org
Subject: The banner(6) manpage, as well as the program's `usage' line, could use improvement
X-Send-Pr-Version: www-1.0

>Number:         46103
>Category:       bin
>Synopsis:       The banner(6) manpage, as well as the program's `usage' line, could use improvement
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    bin-bug-people
>State:          closed
>Class:          doc-bug
>Submitter-Id:   net
>Arrival-Date:   Sun Feb 26 20:55:00 +0000 2012
>Closed-Date:    Sun Feb 26 21:07:17 +0000 2012
>Last-Modified:  Sun Feb 26 21:10:02 +0000 2012
>Originator:     Bug Hunting
>Release:        NetBSD-current (6.99.3)
>Organization:
>Environment:
>Description:
The banner(6) manpage and the program's `usage' line are inconsistent.
Also, the manpage could use other improvements, including adding
`EXIT STATUS' and `SEE ALSO' sections, as well as putting the example already
included in it, although a bit altered with the patch below as well, in an
`EXAMPLES' section of its own.
>How-To-Repeat:
Show the manpage:
   $ man 6 banner
   [output omitted]

Show the manpage's incorrect (the ``message'' argument is optional, and if it's
given, there is only one anyway) `SYNOPSIS' section:
   $ man -s 6 -h banner
   banner [-w width] message ...

Print the program's incorrect (the ``message'' argument is missing) `usage'-line,
using a non-existent option:
   $ /usr/games/banner -q
   banner: unknown option -- q
   usage: banner [-w width]
>Fix:
Apply the following proposed patch (the MD5-sum of this patch is
fbb4d493dc39945a42d3568bf0a83261, please verify it before applying;
also, please re-alter the date in the `.Dd' (which was changed here explicitly
because of non-trivial changes) macro when needed):

Index: games/banner/banner.6
===================================================================
RCS file: /cvsroot/src/games/banner/banner.6,v
retrieving revision 1.17
diff -u -r1.17 banner.6
--- games/banner/banner.6	14 May 2010 19:02:28 -0000	1.17
+++ games/banner/banner.6	26 Feb 2012 19:12:02 -0000
@@ -29,32 +29,43 @@
 .\"
 .\"	@(#)banner.6	8.2 (Berkeley) 4/29/95
 .\"
-.Dd December 14, 2006
+.Dd February 26, 2012
 .Dt BANNER 6
 .Os
 .Sh NAME
 .Nm banner
-.Nd print large banner on printer
+.Nd print large banners
 .Sh SYNOPSIS
 .Nm
 .Op Fl w Ar width
-.Ar message ...
+.Op Ar message
 .Sh DESCRIPTION
 .Nm
-prints a large, high quality banner on the standard output.
-If the message is omitted, it prompts for and
-reads one line of its standard input.
+prints a large, high quality banner on standard output.
+If
+.Ar message
+is omitted, one line of standard input is read for it.
+A prompt is written to standard error in case standard input is
+connected to a terminal.
+.Pp
 If
 .Fl w
-is given, the output is scrunched down from a width of 132 to
+is given, the output is scrunched down from a width of 132 (the default) to
 .Ar width ,
 suitable for a narrow terminal.
-For example:
-.Pp
-.Dl "/usr/games/banner -w 80 Hello"
 .Pp
 The output should be printed on paper of the appropriate width,
 with no breaks between the pages.
+.Sh EXIT STATUS
+.Ex -std
+.Sh EXAMPLES
+The following command will print the current date as a banner on
+standard output, using a width of 80:
+.Pp
+.Dl "/usr/games/banner -w 80 `date`"
+.Sh SEE ALSO
+.Xr banner 1 ,
+.Xr lpr 1
 .Sh AUTHORS
 .An Mark Horton
 .Sh BUGS
Index: games/banner/banner.c
===================================================================
RCS file: /cvsroot/src/games/banner/banner.c,v
retrieving revision 1.19
diff -u -r1.19 banner.c
--- games/banner/banner.c	29 Aug 2011 20:30:36 -0000	1.19
+++ games/banner/banner.c	26 Feb 2012 19:12:03 -0000
@@ -45,7 +45,7 @@

 /*
  * banner - prints large signs
- * banner [-w width] [-d] [-t] message ...
+ * banner [-dt] [-w width] [message]
  */

 #include <err.h>
@@ -1051,7 +1051,7 @@
 			break;
 		case '?':
 		default:
-			(void)fprintf(stderr, "usage: banner [-w width]\n");
+			(void)fprintf(stderr, "usage: banner [-w width] [message]\n");
 			exit(1);
 		}
 	argc -= optind;

>Release-Note:

>Audit-Trail:

State-Changed-From-To: open->closed
State-Changed-By: wiz@NetBSD.org
State-Changed-When: Sun, 26 Feb 2012 21:07:17 +0000
State-Changed-Why:
Committed, thanks!


From: "Thomas Klausner" <wiz@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/46103 CVS commit: src/games/banner
Date: Sun, 26 Feb 2012 21:06:59 +0000

 Module Name:	src
 Committed By:	wiz
 Date:		Sun Feb 26 21:06:59 UTC 2012

 Modified Files:
 	src/games/banner: banner.6 banner.c

 Log Message:
 Man page and usage cleanups from Bug Hunting in PR 46103.


 To generate a diff of this commit:
 cvs rdiff -u -r1.17 -r1.18 src/games/banner/banner.6
 cvs rdiff -u -r1.19 -r1.20 src/games/banner/banner.c

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2007 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.