mtimeout.1: Use correct dash for number ranges.
[misc] / space.1
CommitLineData
df33ee54
MW
1.\" -*-nroff-*-
2.ie t .ds o \(bu
3.el .ds o *
4.de hP
5.IP
6\fB\h'-\w'\\$1'u-1m'\\$1\h'1m'\fP\c
7..
8.TH space 1 "27 January 2007" "Straylight/Edgeware"
9.SH NAME
10space \- check and fix whitespace in files
11.SH SYNOPSIS
12.B space
18873429 13.RB [ \-clmtuv ]
df33ee54
MW
14.RB [ \-i \c
15.RI [ backup ]]
16.RI [ file ...]
17.SH DESCRIPTION
18The (low-budget)
19.B space
20program identifies and fixes problematic use of whitespace in text
21files. In particular, it will notice and (if you want) fix
22.hP \*o
23.I trailing whitespace
24\(en tabs and spaces just before a newline;
25.hP \*o
26.I spaces before tabs
27\(en which are obviously pointless;
28.hP \*o
29.I end-of-file in mid-line
30\(en which confuses a number of programs,
31.BR diff (1)
32not least;
c5ed60be 33.hP \*o
18873429
MW
34.I trailing blank lines
35\(en which some editors, notably Emacs, introduce by default;
36.hP \*o
c5ed60be
MW
37.I groups of spaces which could be replaced by tabs
38\(en replacing them with the appropriate tab characters; or
df33ee54
MW
39.hP \*o
40.I all tab characters
41\(en replacing them with appropriate numbers of spaces.
42.PP
43The program is capable of fixing files in place (leaving backups if you
44ask for them).
45.PP
46The following command-line options are recognized.
47.TP
48.B \-h
49Give a short help message describing the options available.
50.TP
51.B \-c
52Just check files, exiting zero if they're all OK, or 1 if there are
53whitespace problems with any of them; exit 32 if there are actual
54errors. You may want the
55.B \-v
56option with this; without it,
57.B space
58is silent.
59.TP
18873429
MW
60.B \-l
61Check the file for trailing blank lines, i.e., lines containing only
62horizontal whitespace. With
63.BR \-v ,
64report if the file has trailing blank lines; without
65.BR \-c ,
66remove these trailing blank lines from the output.
67.TP
a04e47fa
MW
68.BR \-v
69Report detailed messages about whitespace problems encountered. Useful
70with
71.BR \-c ,
72for example.
73.TP
df33ee54
MW
74.BR \-i [ \fIbackup ]
75Modify all the
76.IR file s
77in place. During processing, the fixed copy of the file is written to
78some new name not currently in use. If the processing was successful,
79the old
80.I file
81is renamed to
c5ed60be 82.I file "" backup
df33ee54
MW
83and the new file is renamed to
84.IR file .
85If something very complicated goes wrong at just the right moment, it's
86possible that you'll be left with just
87.I filebackup
88but that's not very likely. The new file is created with the same
89permissions as the old file, but no attempt is made to give it the same
90owner or anything like that.
91.TP
92.B \-m
93Worry about tabs in the middle of lines as well as tabs forming the
94initial indentation. Normally, identify (and fix) tabs preceded by
95spaces in the middle of lines; with
96.BR \-t ,
97fix all groups of whitespace which could be turned into tabs.
98.TP
99.B \-t
100Turn runs of horizontal whitespace into tabs where possible.
101With
102.BR \-c ,
103only complain about runs of space which could be turned into tabs but
104don't actually do anything. By default, only runs of whitespace at the
105starts of lines are affected. With
106.BR \-m ,
107however, all runs of whitespace are considered to be fair game. The
108rules for internal whitespace are as follows. A run at the start of a
109line, or which contains a tab is always fair game; a run of two or more
110spaces is fair game
111.I unless
112it follows a
113.RB ` . '
114or
115.RB ` : '
116character, either immediately or separated only by
117.RB ` """" '
118or
119.RB ` ' '
120characters, in which case three spaces are required. This is because
121some typists (including the author) put two spaces after a full stop,
122and don't want them randomly turning into tabs for no good reason.
123.TP
124.B \-u
125Turn tabs into appropriate numbers of spaces. With
126.BR \-c ,
127only complain about finding tabs, but don't actually do anything. All
128tabs are considered fair game here and the
129.B \-m
130option is ignored.
131.PP
132Tab stops are assumed to occur every eight columns, as is usual.
133.SH BUGS
134There's no way yet of controlling where the tab stops are.
135.PP
136This space program doesn't even attempt moon landings. The space man
137page doesn't have wiggly antennae.
c5ed60be
MW
138.PP
139The jokes in the man page are somewhat lame.
df33ee54
MW
140.SH AUTHOR
141Mark Wooding, <mdw@distorted.org.uk>