summaryrefslogtreecommitdiffstats
path: root/usr.bin/banner
diff options
context:
space:
mode:
authorcharnier <charnier@FreeBSD.org>2000-03-26 14:30:51 +0000
committercharnier <charnier@FreeBSD.org>2000-03-26 14:30:51 +0000
commit1006ba9553954a499bd5843aeddafd7933542b85 (patch)
tree275bcd5916a10f23d125eb6e4b76ddd239021e0c /usr.bin/banner
parent4bd9a70bb4f3db1712ecdb4d0917a165f5577b02 (diff)
downloadFreeBSD-src-1006ba9553954a499bd5843aeddafd7933542b85.zip
FreeBSD-src-1006ba9553954a499bd5843aeddafd7933542b85.tar.gz
Add -d and -t flags to usage. Add usage().
Diffstat (limited to 'usr.bin/banner')
-rw-r--r--usr.bin/banner/banner.625
-rw-r--r--usr.bin/banner/banner.c14
2 files changed, 29 insertions, 10 deletions
diff --git a/usr.bin/banner/banner.6 b/usr.bin/banner/banner.6
index 119a3e8..5c67fcf 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 804f036..387ccc6 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);
+}
OpenPOWER on IntegriCloud