summaryrefslogtreecommitdiffstats
path: root/usr.bin
diff options
context:
space:
mode:
authorbde <bde@FreeBSD.org>1997-07-06 03:28:40 +0000
committerbde <bde@FreeBSD.org>1997-07-06 03:28:40 +0000
commitc986b011590633531c0a369a72cdb14682810cb0 (patch)
tree4fdf5bf3fbfd49fc2792723c71f4a1ab70653f50 /usr.bin
parenta8de850f7b099919b206864302797257b8ebfa2a (diff)
downloadFreeBSD-src-c986b011590633531c0a369a72cdb14682810cb0.zip
FreeBSD-src-c986b011590633531c0a369a72cdb14682810cb0.tar.gz
Import Lite2's src/usr.bin/banner. The man page is still on the vendor
branch and this import converts it to mdoc format.
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/banner/banner.664
-rw-r--r--usr.bin/banner/banner.c18
2 files changed, 39 insertions, 43 deletions
diff --git a/usr.bin/banner/banner.6 b/usr.bin/banner/banner.6
index 3427a66..eb6414f 100644
--- a/usr.bin/banner/banner.6
+++ b/usr.bin/banner/banner.6
@@ -1,4 +1,4 @@
-.\" Copyright (c) 1980, 1993
+.\" Copyright (c) 1980, 1993, 1995
.\" The Regents of the University of California. All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
@@ -29,44 +29,40 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.\" @(#)banner.6 8.1 (Berkeley) 6/6/93
+.\" @(#)banner.6 8.2 (Berkeley) 4/29/95
.\"
-.TH BANNER 6 "June 6, 1993"
-.UC
-.SH NAME
-banner \- print large banner on printer
-.SH SYNOPSIS
-.B /usr/games/banner
-[
-.BI \-w n
-]
-message ...
-.SH DESCRIPTION
-.I Banner
+.Dd "April 29, 1995"
+.Dt BANNER 6
+.Os
+.Sh NAME
+.Nm banner
+.Nd print large banner on printer
+.Sh SYNOPSIS
+.Nm banner
+.Op Fl w Ar n
+.Ar message ...
+.Sh DESCRIPTION
+.Nm Banner
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. If
-.B \-w
-is given, the output is scrunched down from a width of 132 to
-.I n ,
-suitable for a narrow terminal. If
-.I n
-is omitted, it defaults to 80.
-.PP
-The output should be printed on a hard-copy device, up to 132 columns wide,
-with no breaks between the pages. The volume is great enough that you
-may want
-a printer or a fast hardcopy terminal, but if you are patient, a
-decwriter or other 300 baud terminal will do.
-.SH BUGS
+If the message is omitted, it prompts for and reads one line of its
+standard input.
+If
+.Fl w
+is given, the output is changed from a width of 132 to
+.Ar n ,
+suitable for a narrow terminal.
+.Pp
+The output should be printed on paper of the appropriate width,
+with no breaks between the pages.
+.Sh BUGS
Several ASCII characters are not defined, notably <, >, [, ], \\,
-^, _, {, }, |, and ~. Also, the characters ", ', and & are funny
-looking (but in a useful way.)
-.PP
+^, _, {, }, |, and ~.
+Also, the characters ", ', and & are funny looking (but in a useful way.)
+.Pp
The
-.B \-w
+.Fl w
option is implemented by skipping some rows and columns.
The smaller it gets, the grainier the output.
Sometimes it runs letters together.
-.SH AUTHOR
+.Sh AUTHOR
Mark Horton
diff --git a/usr.bin/banner/banner.c b/usr.bin/banner/banner.c
index 6c8e560..559f056 100644
--- a/usr.bin/banner/banner.c
+++ b/usr.bin/banner/banner.c
@@ -38,7 +38,7 @@ static char copyright[] =
#endif /* not lint */
#ifndef lint
-static char sccsid[] = "@(#)banner.c 8.3 (Berkeley) 4/2/94";
+static char sccsid[] = "@(#)banner.c 8.4 (Berkeley) 4/29/95";
#endif /* not lint */
/*
@@ -1026,26 +1026,26 @@ int width = DWIDTH; /* -w option: scrunch letters to 80 columns */
int
main(argc, argv)
int argc;
- char **argv;
+ char *argv[];
{
int ch;
while ((ch = getopt(argc, argv, "w:td")) != EOF)
- switch(ch) {
- case 'w':
- width = atoi(optarg);
- if (width <= 0)
- width = 80;
- break;
+ switch (ch) {
case 'd':
debug = 1;
break;
case 't':
trace = 1;
break;
+ case 'w':
+ width = atoi(optarg);
+ if (width <= 0)
+ errx(1, "illegal argument for -w option");
+ break;
case '?':
default:
- fprintf(stderr, "usage: banner [-w width]\n");
+ (void)fprintf(stderr, "usage: banner [-w width]\n");
exit(1);
}
argc -= optind;
OpenPOWER on IntegriCloud