=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/expand/expand.1,v retrieving revision 1.9 retrieving revision 1.10 diff -u -r1.9 -r1.10 --- src/usr.bin/expand/expand.1 2003/10/27 12:24:11 1.9 +++ src/usr.bin/expand/expand.1 2006/10/16 15:45:09 1.10 @@ -1,4 +1,4 @@ -.\" $OpenBSD: expand.1,v 1.9 2003/10/27 12:24:11 jmc Exp $ +.\" $OpenBSD: expand.1,v 1.10 2006/10/16 15:45:09 jmc Exp $ .\" $NetBSD: expand.1,v 1.3 1995/09/02 06:19:45 jtc Exp $ .\" .\" Copyright (c) 1980, 1990, 1993 @@ -39,28 +39,11 @@ .Nd expand tabs to spaces, and vice versa .Sh SYNOPSIS .Nm expand -.Op Fl Ns Ar tabstop -.Oo Xo -.Sm off -.Fl Ar tab1 , tab2 , -.Ar ... , Ar tabn -.Sm on -.Oc -.Xc -.Op Ar file Ar ... -.Nm expand -.Op Fl t Ar tabstop -.Oo Xo -.Sm off -.Fl t\ \& Ar tab1 , tab2 , -.Ar ... , Ar tabn -.Sm on -.Oc -.Xc -.Op Ar file Ar ... +.Op Fl t Ar tablist +.Op Ar .Nm unexpand .Op Fl a -.Op Ar file Ar ... +.Op Ar .Sh DESCRIPTION .Nm expand processes the named files or the standard input, @@ -72,28 +55,45 @@ (before sorting, looking at specific columns, etc.) that contain tabs. .Pp -If a single -.Ar tabstop -argument is given, tabs are set -.Ar tabstop +If the argument to +.Fl t , +.Ar tablist , +consists of a single numerical argument, tabs are set +.Ar tablist spaces apart instead of the default 8. -If multiple tabstops are given, then the tabs are set at those +If multiple +.Fl t +options are given, then the tabs are set at those specific columns. -In the synopsis above, both forms of the -.Nm -command are identical. .Pp -If a list of tabstops is given, it should consist of a list -of two or more positive decimal integers, in ascending order. -In the event of having to process a +Otherwise the argument to +.Fl t +may consist of a list +of two or more positive decimal integers, +comma separated, +in ascending order: +in the event of having to process a .Aq tab -at a position beyond the last of those specified in a multiple tabstop list, +at a position beyond the last of those specified in a multiple +.Fl t +list, the .Aq tab is replaced by a single .Aq space character. .Pp +This implementation of +.Nm +additionally allows +.Ar tablist +to be specified without using the +.Fl t +flag, by prefixing +.Ar tablist +with a dash +.Pq - . +.Pp .Nm unexpand puts tabs back into the data from the standard input or the named files and writes the result on the standard output. @@ -118,16 +118,14 @@ and .Nm unexpand utilities are compliant with the -.St -p1003.1 +.St -p1003.1-2004 specification, with the following exceptions: .Bl -bullet -offset indent .It .Tn POSIX does not support specifying tabstops without use of the .Fl t -flag (first form in -.Sx SYNOPSIS -above). +flag. .It .Tn POSIX specifies that multiple tabstops may be given separated by