Start enumerate option with `The following options are available' like

most of the utilities.
.Nm prog -> .Nm
Remove unused include
Make use of getopt() instead of parsing params by hand.
This commit is contained in:
Philippe Charnier 2000-07-24 20:22:49 +00:00
parent 91ea161570
commit 8ad08d33c1
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=63811
2 changed files with 19 additions and 21 deletions

View File

@ -51,8 +51,8 @@ is destructive.
Half-line characters and underlining (changed to dashing `\-')
are placed on new lines in between the normal output lines.
.Pp
Available options:
.Bl -tag -width Ds
The following options are available:
.Bl -tag -width indent
.It Fl
Suppress all underlining.
This option is especially useful for previewing
@ -60,7 +60,7 @@ This option is especially useful for previewing
tables from
.Xr tbl 1 .
.It Fl 2
Causes all half-lines to be printed, effectively double spacing the output.
Cause all half-lines to be printed, effectively double spacing the output.
Normally, a minimal space output format is used which will suppress empty
lines.
The program never suppresses two consecutive empty lines, however.
@ -71,7 +71,7 @@ contains superscripts and subscripts which would otherwise be invisible.
.El
.Sh EXAMPLES
A typical use of
.Nm colcrt
.Nm
would be
.Bd -literal
tbl exum2.n \&| nroff \-ms \&| colcrt \- \&| more

View File

@ -46,7 +46,6 @@ static const char rcsid[] =
#endif /* not lint */
#include <err.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <unistd.h>
@ -86,23 +85,22 @@ main(argc, argv)
{
int c;
char *cp, *dp;
int ch;
argc--;
argv++;
while (argc > 0 && argv[0][0] == '-') {
switch (argv[0][1]) {
case 0:
suppresul = 1;
break;
case '2':
printall = 1;
break;
default:
usage();
while ((ch = getopt(argc, argv, "-2")) != -1)
switch (ch) {
case '-':
suppresul = 1;
break;
case '2':
printall = 1;
break;
default:
usage();
}
argc--;
argv++;
}
argc -= optind;
argv += optind;
do {
if (argc > 0) {
close(0);
@ -193,7 +191,7 @@ main(argc, argv)
static void
usage()
{
fprintf(stderr, "usage: colcrt [ - ] [ -2 ] [ file ... ]\n");
fprintf(stderr, "usage: colcrt [-] [-2] [file ...]\n");
exit(1);
}