diff options
| author | Paul Saab <ps@FreeBSD.org> | 2000-07-01 12:32:35 +0000 |
|---|---|---|
| committer | Paul Saab <ps@FreeBSD.org> | 2000-07-01 12:32:35 +0000 |
| commit | 3110f35b9074c5bdc29a31cc23c1933419d35f61 (patch) | |
| tree | c626407165e093f1faa4fa8128014640ae64e051 | |
| parent | 74b36d1cb2700f94cdb0fdfafb69ecbb99b29ae1 (diff) | |
Notes
| -rw-r--r-- | usr.bin/banner/banner.6 | 25 | ||||
| -rw-r--r-- | usr.bin/banner/banner.c | 14 | ||||
| -rw-r--r-- | usr.bin/what/what.c | 12 |
3 files changed, 38 insertions, 13 deletions
diff --git a/usr.bin/banner/banner.6 b/usr.bin/banner/banner.6 index 119a3e822c7b..5c67fcf853ad 100644 --- a/usr.bin/banner/banner.6 +++ b/usr.bin/banner/banner.6 @@ -40,23 +40,34 @@ .Nd print large banner on printer .Sh SYNOPSIS .Nm banner -.Op Fl w Ar n +.Op Fl d +.Op Fl t +.Op Fl w Ar width .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 -.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. +.Pp +The following options are available: +.Bl -tag -width indent +.It Fl d +Enable debug. +.It Fl t +Enable trace. +.It Fl w Ar width +Change the output from a width of 132 to +.Ar width , +suitable for a narrow terminal. +.El .Sh BUGS -Several ASCII characters are not defined, notably <, >, [, ], \\, +Several +.Tn ASCII +characters are not defined, notably <, >, [, ], \\, ^, _, {, }, |, and ~. Also, the characters ", ', and & are funny looking (but in a useful way.) .Pp diff --git a/usr.bin/banner/banner.c b/usr.bin/banner/banner.c index 804f0365b961..387ccc622bc8 100644 --- a/usr.bin/banner/banner.c +++ b/usr.bin/banner/banner.c @@ -1027,6 +1027,8 @@ char print[DWIDTH]; int debug, i, j, linen, max, nchars, pc, term, trace, x, y; int width = DWIDTH; /* -w option: scrunch letters to 80 columns */ +static void usage __P((void)); + int main(argc, argv) int argc; @@ -1049,8 +1051,7 @@ main(argc, argv) break; case '?': default: - (void)fprintf(stderr, "usage: banner [-w width]\n"); - exit(1); + usage(); } argc -= optind; argv += optind; @@ -1109,7 +1110,7 @@ main(argc, argv) for (i = 0; i < nchars; i++) if ((u_char) message[i] >= NCHARS || asc_ptr[(u_char) message[i]] == 0) { - warnx("The character '%c' is not in my character set", + warnx("the character '%c' is not in my character set", message[i]); j++; } @@ -1169,3 +1170,10 @@ main(argc, argv) free(message); exit(0); } + +static void +usage() +{ + fprintf(stderr, "usage: banner [-d] [-t] [-w width] message ...\n"); + exit(1); +} diff --git a/usr.bin/what/what.c b/usr.bin/what/what.c index 5a9bf35018ec..8bb97e508344 100644 --- a/usr.bin/what/what.c +++ b/usr.bin/what/what.c @@ -54,6 +54,7 @@ static int sflag; static int found; void search __P((void)); +static void usage __P((void)); /* * what @@ -71,9 +72,7 @@ main(argc, argv) sflag = 1; break; default: - (void)fprintf(stderr, - "usage: what [-s] file ...\n"); - exit(1); + usage(); } argv += optind; @@ -90,6 +89,13 @@ main(argc, argv) exit(!found); } +static void +usage() +{ + (void)fprintf(stderr, "usage: what [-s] file ...\n"); + exit(1); +} + void search() { |
