Add -d and -t flags to usage. Add usage().
This commit is contained in:
parent
66f8a9c045
commit
eb257e6ec5
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=58608
@ -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
|
||||
|
@ -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);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user