Update cols manpage

This commit is contained in:
sin 2014-12-08 15:07:19 +00:00
parent 45086e76f9
commit 909ffd5bf7
2 changed files with 31 additions and 25 deletions

54
cols.1
View File

@ -1,34 +1,40 @@
.TH COLS 1 sbase\-VERSION
.SH NAME
cols \- columnize output
.SH SYNOPSIS
.B cols
.RB [ \-c
.IR chars ]
.RI [ file ...]
.SH DESCRIPTION
.B cols
.Dd December 8, 2014
.Dt COLS 1 sbase\-VERSION
.Os
.Sh NAME
.Nm cols
.Nd columnize output
.Sh SYNOPSIS
.Nm cols
.Op Fl c Ar chars
.Op Ar file ...
.Sh DESCRIPTION
.Nm
reads each file in sequence and writes them to stdout,
in as many vertical columns as will fit in
.I chars
.Ar chars
character columns.
If no file is given, cols reads from stdin.
.SH OPTIONS
.TP
.BI \-c " chars"
specifies the maximum number of character columns to use
.Sh OPTIONS
.Bl -tag -width xxxxxxxx
.It Fl c Ar chars
Specifies the maximum number of character columns to use
(unless the input contains lines longer than
.I chars
.Ar chars
characters). By default cols tries to figure out the width
of the output device, if that fails it defaults to 65
chars.
.SH BUGS
.Sh BUGS
This implementation of
.B cols
assumes that every byte is a character
which takes up one column on the screen.
It does not handle TAB characters correctly.
.B cols
.Nm
assumes that each UTF-8 code point occupies one character cell,
and thus mishandles TAB characters (among others).
.Pp
.Nm
currently mangles files which contain embedded NULs.
.B cols
does not allow the user to set a default width in its environment.
.Sh HISTORY
.Nm
is similar to the mc(1) command on Plan 9. It was renamed to
.Nm
to avoid the name collision with the popular file manager
Midnight Commander.

2
cols.c
View File

@ -20,7 +20,7 @@ static long n_rows;
static void
usage(void)
{
eprintf("usage: %s [-c chars] [FILE...]\n", argv0);
eprintf("usage: %s [-c chars] [file ...]\n", argv0);
}
int