diff options
Diffstat (limited to 'usr.bin')
-rw-r--r-- | usr.bin/banner/banner.6 | 64 | ||||
-rw-r--r-- | usr.bin/banner/banner.c | 18 |
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; |