X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=docs%2Fperltidy.1;h=e75cfa43ed8f3a16d5109a9ed1d508f54d80a75a;hb=8aa69fbac36a21cad0a1c0d5b3452a546d427d7f;hp=fa71edd6c1470578c10daeb4bea681e222c40a41;hpb=8650cadc9aaa12d0fb1d7025ad8fefda9c3df636;p=perltidy.git diff --git a/docs/perltidy.1 b/docs/perltidy.1 index fa71edd..e75cfa4 100644 --- a/docs/perltidy.1 +++ b/docs/perltidy.1 @@ -1,4 +1,4 @@ -.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.3 +.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.32 .\" .\" Standard preamble: .\" ======================================================================== @@ -25,11 +25,11 @@ .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left -.\" double quote, and \*(R" will give a right double quote. | will give a -.\" real vertical bar. \*(C+ will give a nicer C++. Capital omega is used to -.\" do unbreakable dashes and therefore won't be available. \*(C` and \*(C' -.\" expand to `' in nroff, nothing in troff, for use with C<>. -.tr \(*W-|\(bv\*(Tr +.\" double quote, and \*(R" will give a right double quote. \*(C+ will +.\" give a nicer C++. Capital omega is used to do unbreakable dashes and +.\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, +.\" nothing in troff, for use with C<>. +.tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- @@ -129,7 +129,7 @@ .\" ======================================================================== .\" .IX Title "PERLTIDY 1" -.TH PERLTIDY 1 "2006-06-13" "perl v5.8.7" "User Contributed Perl Documentation" +.TH PERLTIDY 1 "2007-04-24" "perl v5.8.8" "User Contributed Perl Documentation" .SH "NAME" perltidy \- a perl script indenter and reformatter .SH "SYNOPSIS" @@ -529,8 +529,6 @@ where s=\f(CW\*(C`win\*(C'\fR, \f(CW\*(C`dos\*(C'\fR, \f(CW\*(C`unix\*(C'\fR, or to output line endings for a specific system. Normally, perltidy writes files with the line separator character of the host system. The \f(CW\*(C`win\*(C'\fR and \f(CW\*(C`dos\*(C'\fR flags have an identical result. -\&\fB\s-1NOTE\s0\fR: This only works under unix-like systems and is ignored under -other systems. .IP "\fB\-ple\fR, \fB\-\-preserve\-line\-endings\fR" 4 .IX Item "-ple, --preserve-line-endings" This flag tells perltidy to write its output files with the same line @@ -539,8 +537,6 @@ endings as the input file, if possible. It should work for input comes from a filename (rather than stdin, for example). If perltidy has trouble determining the input file line ending, it will revert to the default behavior of using the line ending of the host system. -\&\fB\s-1NOTE\s0\fR: This only works under unix-like systems and is ignored under -other systems. .Sh "Code Indentation Control" .IX Subsection "Code Indentation Control" .IP "\fB\-ci=n\fR, \fB\-\-continuation\-indentation=n\fR" 4 @@ -904,7 +900,7 @@ a space takes priority. .Sp It is necessary to have a list of all token types in order to create this type of input. Such a list can be obtained by the command -\&\fB\-\-dump\-token\-types\fR. Also try the \-D flag on a short snippet of code +\&\fB\-\-dump\-token\-types\fR. Also try the \fB\-D\fR flag on a short snippet of code and look at the .DEBUG file to see the tokenization. .Sp \&\fB\s-1WARNING\s0\fR Be sure to put these tokens in quotes to avoid having them @@ -1815,11 +1811,11 @@ command-line parameter always overwrites the previous one before perltidy ever sees it. .Sp By default, perltidy breaks \fBafter\fR these token types: - % + \- * / x != == >= <= =~ !~ < > | & >= < - = **= += *= &= <<= &&= \-= /= |= >>= ||= .= %= ^= x= + % + \- * / x != == >= <= =~ !~ < > | & + = **= += *= &= <<= &&= \-= /= |= >>= ||= //= .= %= ^= x= .Sp And perltidy breaks \fBbefore\fR these token types by default: - . << >> \-> && || + . << >> \-> && || // .Sp To illustrate, to cause a break after a concatenation operator, \f(CW'.'\fR, rather than before it, the command line would be @@ -1836,7 +1832,7 @@ math operators \f(CW'+'\fR, \f(CW'\-'\fR, \f(CW'/'\fR, and \f(CW'*'\fR: .Ve .Sp These commands should work well for most of the token types that perltidy uses -(use \fB\-\-dump\-token\-types\fR for a list). Also try the \-D flag on a short +(use \fB\-\-dump\-token\-types\fR for a list). Also try the \fB\-D\fR flag on a short snippet of code and look at the .DEBUG file to see the tokenization. However, for a few token types there may be conflicts with hardwired logic which cause unexpected results. One example is curly braces, which should be controlled @@ -1989,9 +1985,9 @@ By default, perltidy will retain a breakpoint before keywords which may return lists, such as \f(CW\*(C`sort\*(C'\fR and . This allows chains of these operators to be displayed one per line. Use \fB\-nbok\fR to prevent retaining these breakpoints. -.IP "\fB\-bot\fR, \fB\-\-break\-at\-old\-trinary\-breakpoints\fR" 4 -.IX Item "-bot, --break-at-old-trinary-breakpoints" -By default, if a conditional (trinary) operator is broken at a \f(CW\*(C`:\*(C'\fR, +.IP "\fB\-bot\fR, \fB\-\-break\-at\-old\-ternary\-breakpoints\fR" 4 +.IX Item "-bot, --break-at-old-ternary-breakpoints" +By default, if a conditional (ternary) operator is broken at a \f(CW\*(C`:\*(C'\fR, then it will remain broken. To prevent this, and thereby form longer lines, use \fB\-nbot\fR. .IP "\fB\-iob\fR, \fB\-\-ignore\-old\-breakpoints\fR" 4 @@ -2072,6 +2068,19 @@ style overrides the default style with the following parameters: .Vb 1 \& \-lp \-bl \-noll \-pt=2 \-bt=2 \-sbt=2 \-icp .Ve +.IP "\fB\-pbp\fR, \fB\-\-perl\-best\-practices\fR" 4 +.IX Item "-pbp, --perl-best-practices" +\&\fB\-pbp\fR is an abbreviation for the parameters in the book \fBPerl Best Practices\fR +by Damian Conway: +.Sp +.Vb 3 +\& \-l=78 \-i=4 \-ci=4 \-st \-se \-vt=2 \-cti=0 \-pt=1 \-bt=1 \-sbt=1 \-bbt=1 \-nsfs \-nolq +\& \-wbb="% + \- * / x != == >= <= =~ !~ < > | & = +\& **= += *= &= <<= &&= \-= /= |= >>= ||= //= .= %= ^= x=" +.Ve +.Sp +Note that the \-st and \-se flags make perltidy act as a filter on one file only. +These can be overridden with \-nst and \-nse if necessary. .Sh "Other Controls" .IX Subsection "Other Controls" .IP "Deleting selected text" 4 @@ -2636,7 +2645,7 @@ The following list shows all short parameter names which allow a prefix \& dwrs dws f fll frm fs hsc html ibc icb icp iob isbc lal log \& lp lsl ohbr okw ola oll opr opt osbr otr ple ple pod pvl q \& sbc sbl schb scp scsb sct se sfp sfs skp sob sohb sop sosb sot -\& ssc st sts syn t tac tbc toc tp tqw tsc w x +\& ssc st sts syn t tac tbc toc tp tqw tsc w x bar .Ve .PP Equivalently, the prefix 'no' or 'no\-' on the corresponding long names may be @@ -2695,7 +2704,7 @@ purpose of this rule is to prevent generating confusing filenames such as \&\fIperlstyle\fR\|(1), \fIPerl::Tidy\fR\|(3) .SH "VERSION" .IX Header "VERSION" -This man page documents perltidy version 20060614. +This man page documents perltidy version 20070424. .SH "CREDITS" .IX Header "CREDITS" Michael Cartmell supplied code for adaptation to \s-1VMS\s0 and helped with