=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/indent/indent.1,v retrieving revision 1.13 retrieving revision 1.14 diff -c -r1.13 -r1.14 *** src/usr.bin/indent/indent.1 2003/06/12 01:07:27 1.13 --- src/usr.bin/indent/indent.1 2003/11/28 22:04:00 1.14 *************** *** 1,4 **** ! .\" $OpenBSD: indent.1,v 1.13 2003/06/12 01:07:27 deraadt Exp $ .\" .\" Copyright (c) 1980, 1990, 1993 .\" The Regents of the University of California. --- 1,4 ---- ! .\" $OpenBSD: indent.1,v 1.14 2003/11/28 22:04:00 jmc Exp $ .\" .\" Copyright (c) 1980, 1990, 1993 .\" The Regents of the University of California. *************** *** 40,82 **** .Nd indent and format C program source .Sh SYNOPSIS .Nm indent - .Op Ar input-file Op Ar output-file - .Op Fl bad | Fl nbad - .Op Fl bap | Fl nbap .Bk -words ! .Op Fl bbb | Fl nbbb ! .Ek ! .Op Fl \&bc | Fl nbc ! .Op Fl \&bl ! .Op Fl \&br .Op Fl c Ns Ar n .Op Fl \&cd Ns Ar n ! .Bk -words ! .Op Fl cdb | Fl ncdb ! .Ek ! .Op Fl \&ce | Fl nce .Op Fl \&ci Ns Ar n .Op Fl cli Ns Ar n .Op Fl d Ns Ar n .Op Fl \&di Ns Ar n ! .Bk -words ! .Op Fl fc1 | Fl nfc1 ! .Ek .Op Fl i Ns Ar n ! .Op Fl \&ip | Fl nip .Op Fl l Ns Ar n .Op Fl \&lc Ns Ar n ! .Op Fl \&lp | Fl nlp .Op Fl npro ! .Op Fl pcs | Fl npcs ! .Op Fl psl | Fl npsl ! .Op Fl \&sc | Fl nsc ! .Bk -words ! .Op Fl sob | Fl nsob ! .Ek .Op Fl \&st .Op Fl troff ! .Op Fl v | Fl \&nv .Sh DESCRIPTION .Nm is a --- 40,78 ---- .Nd indent and format C program source .Sh SYNOPSIS .Nm indent .Bk -words ! .Op Ar input-file Op Ar output-file ! .Op Fl bad | nbad ! .Op Fl bap | nbap ! .Op Fl bbb | nbbb ! .Op Fl \&bc | nbc ! .Op Fl \&bl | \&br .Op Fl c Ns Ar n .Op Fl \&cd Ns Ar n ! .Op Fl cdb | ncdb ! .Op Fl \&ce | nce .Op Fl \&ci Ns Ar n .Op Fl cli Ns Ar n .Op Fl d Ns Ar n .Op Fl \&di Ns Ar n ! .Op Fl \&dj | ndj ! .Op Fl \&ei | nei ! .Op Fl fc1 | nfc1 .Op Fl i Ns Ar n ! .Op Fl \&ip | nip .Op Fl l Ns Ar n .Op Fl \&lc Ns Ar n ! .Op Fl \&lp | nlp .Op Fl npro ! .Op Fl pcs | npcs ! .Op Fl psl | npsl ! .Op Fl \&sc | nsc ! .Op Fl sob | nsob .Op Fl \&st + .Op Fl T Ns Ar typename .Op Fl troff ! .Op Fl v | \&nv ! .Ek .Sh DESCRIPTION .Nm is a *************** *** 119,125 **** .Ar input-file . .Pp The options listed below control the formatting style imposed by ! .Nm indent . .Bl -tag -width Op .It Fl bad , nbad If --- 115,121 ---- .Ar input-file . .Pp The options listed below control the formatting style imposed by ! .Nm . .Bl -tag -width Op .It Fl bad , nbad If *************** *** 134,139 **** --- 130,137 ---- is specified, a blank line is forced after every procedure body. Default: .Fl nbap . + .Sy Note : + This option currently has no effect. .It Fl bbb , nbbb If .Fl bbb *************** *** 147,158 **** .Fl nbc turns off this option. The default is ! .Fl \&nbc . ! .It Fl \&br , \&bl Specifying .Fl \&bl lines up compound statements like this: - .ne 4 .Bd -literal -offset indent if (...) { --- 145,155 ---- .Fl nbc turns off this option. The default is ! .Fl nbc . ! .It Fl \&bl , \&br Specifying .Fl \&bl lines up compound statements like this: .Bd -literal -offset indent if (...) { *************** *** 163,169 **** Specifying .Fl \&br (the default) makes them look like this: - .ne 3 .Bd -literal -offset indent if (...) { code --- 160,165 ---- *************** *** 181,195 **** Enables (disables) the placement of comment delimiters on blank lines. With this option enabled, comments look like this: .Bd -literal -offset indent ! .ne 3 ! /* ! * this is a comment ! */ .Ed .Pp Rather than like this: .Bd -literal -offset indent ! /* this is a comment */ .Ed .Pp This only affects block comments, not comments to the right of --- 177,190 ---- Enables (disables) the placement of comment delimiters on blank lines. With this option enabled, comments look like this: .Bd -literal -offset indent ! /* ! * this is a comment ! */ .Ed .Pp Rather than like this: .Bd -literal -offset indent ! /* this is a comment */ .Ed .Pp This only affects block comments, not comments to the right of *************** *** 229,240 **** .It Fl d Ns Ar n Controls the placement of comments which are not to the right of code. ! The default ! .Fl \&d\&1 means that such comments are placed one indentation level to the left of code. ! Specifying ! .Fl \&d\&0 lines up these comments with the code. See the section on comment indentation below. .It Fl \&di Ns Ar n --- 224,235 ---- .It Fl d Ns Ar n Controls the placement of comments which are not to the right of code. ! Specifying ! .Fl d1 means that such comments are placed one indentation level to the left of code. ! The default, ! .Fl d0 , lines up these comments with the code. See the section on comment indentation below. .It Fl \&di Ns Ar n *************** *** 260,270 **** will have the same indentation as the preceding .Ic \&if statement. .It Fl fc1 , nfc1 Enables (disables) the formatting of comments that start in column 1. Often, comments whose leading .Ql / ! is in column 1 have been carefully have formatted by the programmer. In such cases, .Fl nfc1 should be --- 255,267 ---- will have the same indentation as the preceding .Ic \&if statement. + The default is + .Fl ei . .It Fl fc1 , nfc1 Enables (disables) the formatting of comments that start in column 1. Often, comments whose leading .Ql / ! is in column 1 have been carefully formatted by the programmer. In such cases, .Fl nfc1 should be *************** *** 279,319 **** margin. The default is .Fl \&ip . .It Fl l Ns Ar n Maximum length of an output line. The default is 75. .It Fl \&lp , nlp ! Lines up code surrounded by parenthesis in continuation lines. ! If a line ! has a left paren which is not closed on that line, then continuation lines ! will be lined up to start at the character position just after the left ! paren. For example, here is how a piece of continued code looks with .Fl nlp in effect: - .ne 2 .Bd -literal -offset indent p1 = first_procedure(second_procedure(p2, p3), ! \ \ third_procedure(p4,p5)); .Ed .Pp - .ne 5 With .Fl lp in effect (the default) the code looks somewhat clearer: .Bd -literal -offset indent ! p1\ =\ first_procedure(second_procedure(p2,\ p3), ! \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ third_procedure(p4,p5)); .Ed .Pp - .ne 5 Inserting two more newlines we get: .Bd -literal -offset indent ! p1\ =\ first_procedure(second_procedure(p2, ! \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ p3), ! \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ third_procedure(p4, ! \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ p5)); .Ed .It Fl npro Causes the profile files, .Pa ./.indent.pro --- 276,321 ---- margin. The default is .Fl \&ip . + .Sy Note : + This option currently has no effect. .It Fl l Ns Ar n Maximum length of an output line. The default is 75. + .Sy Note : + This option currently has no effect. + .It Fl \&lc Ns Ar n + Specify a column width for comments. .It Fl \&lp , nlp ! Lines up code surrounded by parentheses in continuation lines. ! If a line has a left parenthesis which is not closed on that line, ! then continuation lines will be lined up to start at the character position ! just after the left parenthesis. For example, here is how a piece of continued code looks with .Fl nlp in effect: .Bd -literal -offset indent p1 = first_procedure(second_procedure(p2, p3), ! third_procedure(p4,p5)); .Ed .Pp With .Fl lp in effect (the default) the code looks somewhat clearer: .Bd -literal -offset indent ! p1 = first_procedure(second_procedure(p2, p3), ! third_procedure(p4,p5)); .Ed .Pp Inserting two more newlines we get: .Bd -literal -offset indent ! p1 = first_procedure(second_procedure(p2, ! p3), ! third_procedure(p4, ! p5)); .Ed + .Pp + The default is + .Fl lp . .It Fl npro Causes the profile files, .Pa ./.indent.pro *************** *** 339,344 **** --- 341,348 ---- Enables (disables) the placement of asterisks .Pq Ql * at the left edge of all comments. + The default is + .Fl sc . .It Fl sob , nsob If .Fl sob *************** *** 346,351 **** --- 350,357 ---- You can use this to get rid of blank lines after declarations. Default: .Fl nsob . + .Sy Note : + This option currently has no effect. .It Fl \&st Causes .Nm *************** *** 406,412 **** in your login directory and/or the current directory and including whatever switches you like. An ! .Pa \&.indent.pro file in the current directory takes precedence over the one in your login directory. If --- 412,418 ---- in your login directory and/or the current directory and including whatever switches you like. An ! .Pa .indent.pro file in the current directory takes precedence over the one in your login directory. If *************** *** 443,456 **** If a comment is on a line with code it is started in the .Dq comment column , which is set by the ! .Fl c Ns Ns Ar n command line parameter. Otherwise, the comment is started at .Ar n indentation levels less than where code is currently being placed, where .Ar n is specified by the ! .Fl d Ns Ns Ar n command line parameter. If the code on a line extends past the comment column, the comment starts further to the right, and the right margin may be --- 449,462 ---- If a comment is on a line with code it is started in the .Dq comment column , which is set by the ! .Fl c Ns Ar n command line parameter. Otherwise, the comment is started at .Ar n indentation levels less than where code is currently being placed, where .Ar n is specified by the ! .Fl d Ns Ar n command line parameter. If the code on a line extends past the comment column, the comment starts further to the right, and the right margin may be *************** *** 504,515 **** has even more switches than .Xr ls 1 . .Pp - .ne 5 A common mistake that often causes grief is typing: .Pp .Dl indent *.c .Pp ! to the shell in an attempt to indent all the ! .Nm C ! programs in a directory. This is probably a bug, not a feature. --- 510,518 ---- has even more switches than .Xr ls 1 . .Pp A common mistake that often causes grief is typing: .Pp .Dl indent *.c .Pp ! to the shell in an attempt to indent all the C programs in a directory. This is probably a bug, not a feature.