.\" -*-nroff-*- .ie t .ds o \(bu .el .ds o * .de hP .IP \fB\h'-\w'\\$1'u-1m'\\$1\h'1m'\fP\c .. .TH space 1 "27 January 2007" "Straylight/Edgeware" .SH NAME space \- check and fix whitespace in files .SH SYNOPSIS .B space .RB [ \-clmtuv ] .RB [ \-i \c .RI [ backup ]] .RI [ file ...] .SH DESCRIPTION The (low-budget) .B space program identifies and fixes problematic use of whitespace in text files. In particular, it will notice and (if you want) fix .hP \*o .I trailing whitespace \(en tabs and spaces just before a newline; .hP \*o .I spaces before tabs \(en which are obviously pointless; .hP \*o .I end-of-file in mid-line \(en which confuses a number of programs, .BR diff (1) not least; .hP \*o .I trailing blank lines \(en which some editors, notably Emacs, introduce by default; .hP \*o .I groups of spaces which could be replaced by tabs \(en replacing them with the appropriate tab characters; or .hP \*o .I all tab characters \(en replacing them with appropriate numbers of spaces. .PP The program is capable of fixing files in place (leaving backups if you ask for them). .PP The following command-line options are recognized. .TP .B \-h Give a short help message describing the options available. .TP .B \-c Just check files, exiting zero if they're all OK, or 1 if there are whitespace problems with any of them; exit 32 if there are actual errors. You may want the .B \-v option with this; without it, .B space is silent. .TP .B \-l Check the file for trailing blank lines, i.e., lines containing only horizontal whitespace. With .BR \-v , report if the file has trailing blank lines; without .BR \-c , remove these trailing blank lines from the output. .TP .BR \-v Report detailed messages about whitespace problems encountered. Useful with .BR \-c , for example. .TP .BR \-i [ \fIbackup ] Modify all the .IR file s in place. During processing, the fixed copy of the file is written to some new name not currently in use. If the processing was successful, the old .I file is renamed to .I file "" backup and the new file is renamed to .IR file . If something very complicated goes wrong at just the right moment, it's possible that you'll be left with just .I filebackup but that's not very likely. The new file is created with the same permissions as the old file, but no attempt is made to give it the same owner or anything like that. .TP .B \-m Worry about tabs in the middle of lines as well as tabs forming the initial indentation. Normally, identify (and fix) tabs preceded by spaces in the middle of lines; with .BR \-t , fix all groups of whitespace which could be turned into tabs. .TP .B \-t Turn runs of horizontal whitespace into tabs where possible. With .BR \-c , only complain about runs of space which could be turned into tabs but don't actually do anything. By default, only runs of whitespace at the starts of lines are affected. With .BR \-m , however, all runs of whitespace are considered to be fair game. The rules for internal whitespace are as follows. A run at the start of a line, or which contains a tab is always fair game; a run of two or more spaces is fair game .I unless it follows a .RB ` . ' or .RB ` : ' character, either immediately or separated only by .RB ` """" ' or .RB ` ' ' characters, in which case three spaces are required. This is because some typists (including the author) put two spaces after a full stop, and don't want them randomly turning into tabs for no good reason. .TP .B \-u Turn tabs into appropriate numbers of spaces. With .BR \-c , only complain about finding tabs, but don't actually do anything. All tabs are considered fair game here and the .B \-m option is ignored. .PP Tab stops are assumed to occur every eight columns, as is usual. .SH BUGS There's no way yet of controlling where the tab stops are. .PP This space program doesn't even attempt moon landings. The space man page doesn't have wiggly antennae. .PP The jokes in the man page are somewhat lame. .SH AUTHOR Mark Wooding,