Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/games/banner Man page and usage cleanups from Bug Hunting in...



details:   https://anonhg.NetBSD.org/src/rev/1a0b821640b4
branches:  trunk
changeset: 777632:1a0b821640b4
user:      wiz <wiz%NetBSD.org@localhost>
date:      Sun Feb 26 21:06:59 2012 +0000

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

diffstat:

 games/banner/banner.6 |  33 ++++++++++++++++++++++-----------
 games/banner/banner.c |   8 ++++----
 2 files changed, 26 insertions(+), 15 deletions(-)

diffs (97 lines):

diff -r ce5863411865 -r 1a0b821640b4 games/banner/banner.6
--- a/games/banner/banner.6     Sun Feb 26 21:04:10 2012 +0000
+++ b/games/banner/banner.6     Sun Feb 26 21:06:59 2012 +0000
@@ -1,4 +1,4 @@
-.\"    $NetBSD: banner.6,v 1.17 2010/05/14 19:02:28 joerg Exp $
+.\"    $NetBSD: banner.6,v 1.18 2012/02/26 21:06:59 wiz Exp $
 .\"
 .\" Copyright (c) 1980, 1993, 1995
 .\"    The Regents of the University of California.  All rights reserved.
@@ -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
diff -r ce5863411865 -r 1a0b821640b4 games/banner/banner.c
--- a/games/banner/banner.c     Sun Feb 26 21:04:10 2012 +0000
+++ b/games/banner/banner.c     Sun Feb 26 21:06:59 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: banner.c,v 1.19 2011/08/29 20:30:36 joerg Exp $        */
+/*     $NetBSD: banner.c,v 1.20 2012/02/26 21:06:59 wiz Exp $  */
 
 /*
  * Copyright (c) 1980, 1993, 1994
@@ -39,13 +39,13 @@
 #if 0
 static char sccsid[] = "@(#)banner.c   8.4 (Berkeley) 4/29/95";
 #else
-__RCSID("$NetBSD: banner.c,v 1.19 2011/08/29 20:30:36 joerg Exp $");
+__RCSID("$NetBSD: banner.c,v 1.20 2012/02/26 21:06:59 wiz Exp $");
 #endif
 #endif /* not lint */
 
 /*
  * 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;



Home | Main Index | Thread Index | Old Index