diff options
author | Todd C. Miller <millert@cvs.openbsd.org> | 2005-05-15 01:36:14 +0000 |
---|---|---|
committer | Todd C. Miller <millert@cvs.openbsd.org> | 2005-05-15 01:36:14 +0000 |
commit | 849352990664f5be41a014ea13c2f210206ca436 (patch) | |
tree | 1e00d2ab340d760b103207e30d14872451d9fd26 /usr.bin/rs | |
parent | 36fe87de5e8f718d9832621d24b610cf8869736a (diff) |
Make usage/SYNOPSIS saner and sort the options. With jmc@
Diffstat (limited to 'usr.bin/rs')
-rw-r--r-- | usr.bin/rs/rs.1 | 113 | ||||
-rw-r--r-- | usr.bin/rs/rs.c | 6 |
2 files changed, 56 insertions, 63 deletions
diff --git a/usr.bin/rs/rs.1 b/usr.bin/rs/rs.1 index 5bdf78421c2..9d0c8d4d0d8 100644 --- a/usr.bin/rs/rs.1 +++ b/usr.bin/rs/rs.1 @@ -1,4 +1,5 @@ -.\" $OpenBSD: rs.1,v 1.9 2003/07/14 12:51:48 jmc Exp $ +.\" $OpenBSD: rs.1,v 1.10 2005/05/15 01:36:13 millert Exp $ +.\" $FreeBSD: src/usr.bin/rs/rs.1,v 1.4 1999/08/28 01:05:21 peter Exp $ .\" .\" Copyright (c) 1993 .\" The Regents of the University of California. All rights reserved. @@ -28,7 +29,6 @@ .\" SUCH DAMAGE. .\" .\" @(#)rs.1 8.2 (Berkeley) 12/30/93 -.\" $FreeBSD: src/usr.bin/rs/rs.1,v 1.4 1999/08/28 01:05:21 peter Exp $ .\" .Dd December 30, 1993 .Dt RS 1 @@ -38,16 +38,9 @@ .Nd reshape a data array .Sh SYNOPSIS .Nm rs -.Oo -.Sm off -.Xo Fl Oo Op Cm csCS -.Op Ar x -.Op Cm kKgGw -.Op Ar N -.Cm tTeEnyjhHmz Oc -.Xc -.Oc -.Sm on +.Op Fl CcSs Ns Op Ar x +.Op Fl KkGgw Ar N +.Op Fl EejHhnnTtyz .Op Ar rows Op Ar cols .Sh DESCRIPTION .Nm @@ -82,32 +75,67 @@ including transposition of the rows and columns. .Pp The options are as follows: .Bl -tag -width Ds -.It Fl c Ns Ar x -Input columns are delimited by the single character +.It Fl C Ns Ar x +Output columns are delimited by the single character .Ar x . A missing .Ar x is taken to be .Ql ^I . -.It Fl s Ns Ar x -Like -.Fl c , -but maximal strings of -.Ar x -are delimiters. -.It Fl C Ns Ar x -Output columns are delimited by the single character +.It Fl c Ns Ar x +Input columns are delimited by the single character .Ar x . A missing .Ar x is taken to be .Ql ^I . +.It Fl E +Consider each character of input as an array entry. +.It Fl e +Consider each line of input as an array entry. +.It Fl G Ns Ar N +The gutter width has +.Ar N +percent of the maximum column width added to it. +.It Fl g Ns Ar N +The gutter width (inter-column space), normally 2, is taken to be +.Ar N . +.It Fl H +Like +.Fl h , +but also print the length of each line. +.It Fl h +Print the shape of the input array and do nothing else. +The shape is just the number of lines and the number of +entries on the first line. +.It Fl j +Right adjust entries within columns. +.It Fl K Ns Ar N +Like +.Fl k , +but print the ignored lines. +.It Fl k Ns Ar N +Ignore the first +.Ar N +lines of input. +.It Fl m +Do not trim excess delimiters from the ends of the output array. +.It Fl n +On lines having fewer entries than the first line, +use null entries to pad out the line. +Normally, missing entries are taken from the next line of input. .It Fl S Ns Ar x Like .Fl C , but padded strings of .Ar x are delimiters. +.It Fl s Ns Ar x +Like +.Fl c , +but maximal strings of +.Ar x +are delimiters. .It Fl t Fill in the rows of the output array using the columns of the input array, that is, transpose the input while honoring any @@ -121,49 +149,14 @@ Print the pure transpose of the input, ignoring any or .Ar cols specification. -.It Fl k Ns Ar N -Ignore the first -.Ar N -lines of input. -.It Fl K Ns Ar N -Like -.Fl k , -but print the ignored lines. -.It Fl g Ns Ar N -The gutter width (inter-column space), normally 2, is taken to be +.It Fl w Ns Ar N +The width of the display, normally 80, is taken to be the positive +integer .Ar N . -.It Fl G Ns Ar N -The gutter width has -.Ar N -percent of the maximum column width added to it. -.It Fl e -Consider each line of input as an array entry. -.It Fl E -Consider each character of input as an array entry. -.It Fl n -On lines having fewer entries than the first line, -use null entries to pad out the line. -Normally, missing entries are taken from the next line of input. .It Fl y If there are too few entries to make up the output dimensions, pad the output by recycling the input from the beginning. Normally, the output is padded with blanks. -.It Fl h -Print the shape of the input array and do nothing else. -The shape is just the number of lines and the number of -entries on the first line. -.It Fl H -Like -.Fl h , -but also print the length of each line. -.It Fl j -Right adjust entries within columns. -.It Fl w Ns Ar N -The width of the display, normally 80, is taken to be the positive -integer -.Ar N . -.It Fl m -Do not trim excess delimiters from the ends of the output array. .It Fl z Adapt column widths to fit the largest entries appearing in them. .El diff --git a/usr.bin/rs/rs.c b/usr.bin/rs/rs.c index 17976be4565..ff076dd659a 100644 --- a/usr.bin/rs/rs.c +++ b/usr.bin/rs/rs.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rs.c,v 1.14 2005/05/14 23:08:47 millert Exp $ */ +/* $OpenBSD: rs.c,v 1.15 2005/05/15 01:36:13 millert Exp $ */ /*- * Copyright (c) 1993 @@ -39,7 +39,7 @@ static const char copyright[] = #if 0 static const char sccsid[] = "@(#)rs.c 8.1 (Berkeley) 6/6/93"; #else -static const char rcsid[] = "$OpenBSD: rs.c,v 1.14 2005/05/14 23:08:47 millert Exp $"; +static const char rcsid[] = "$OpenBSD: rs.c,v 1.15 2005/05/15 01:36:13 millert Exp $"; #endif #endif /* not lint */ @@ -238,7 +238,7 @@ usage(void) extern char *__progname; fprintf(stderr, - "usage: %s [-[csCS][x][kKgGw][N]tTeEnyjhHm] [rows [cols]]\n", + "usage: %s [-csCS[x]] [-kKgGw N] [-tTeEnyjhHmz] [rows [cols]]\n", __progname); exit(1); } |