~ubuntu-branches/ubuntu/raring/perltidy/raring

« back to all changes in this revision

Viewing changes to docs/perltidy.1

  • Committer: Bazaar Package Importer
  • Author(s): Don Armstrong
  • Date: 2007-08-20 23:07:33 UTC
  • mfrom: (1.1.5 upstream)
  • Revision ID: james.westby@ubuntu.com-20070820230733-d1rhvhzfwrzt8lgt
Tags: 20070801-1
New upstream release

Show diffs side-by-side

added added

removed removed

Lines of Context:
129
129
.\" ========================================================================
130
130
.\"
131
131
.IX Title "PERLTIDY 1"
132
 
.TH PERLTIDY 1 "2007-05-08" "perl v5.8.8" "User Contributed Perl Documentation"
 
132
.TH PERLTIDY 1 "2007-08-01" "perl v5.8.8" "User Contributed Perl Documentation"
133
133
.SH "NAME"
134
134
perltidy \- a perl script indenter and reformatter
135
135
.SH "SYNOPSIS"
1005
1005
Side comments look best when lined up several spaces to the right of
1006
1006
code.  Perltidy will try to keep comments at least n spaces to the
1007
1007
right.  The default is n=4 spaces.
 
1008
.IP "\fB\-fpsc=n\fR,  \fB\-\-fixed\-position\-side\-comment=n\fR" 4
 
1009
.IX Item "-fpsc=n,  --fixed-position-side-comment=n"
 
1010
This parameter tells perltidy to line up side comments in column number \fBn\fR
 
1011
whenever possible.  The default, n=0, is not do do this.
1008
1012
.IP "\fB\-hsc\fR, \fB\-\-hanging\-side\-comments\fR" 4
1009
1013
.IX Item "-hsc, --hanging-side-comments"
1010
1014
By default, perltidy tries to identify and align \*(L"hanging side
1797
1801
break points.
1798
1802
.IP "Controlling whether perltidy breaks before or after operators" 4
1799
1803
.IX Item "Controlling whether perltidy breaks before or after operators"
1800
 
Two command line parameters provide some control over whether
 
1804
Four command line parameters provide some control over whether
1801
1805
a line break should be before or after specific token types.
 
1806
Two parameters give detailed control:
1802
1807
.Sp
1803
1808
\&\fB\-wba=s\fR or \fB\-\-want\-break\-after=s\fR, and
1804
1809
.Sp
1840
1845
.Sp
1841
1846
\&\fB\s-1WARNING\s0\fR Be sure to put these tokens in quotes to avoid having them
1842
1847
misinterpreted by your command shell.
 
1848
.Sp
 
1849
Two additional parameters are available which, though they provide no further
 
1850
capability, can simplify input are:
 
1851
.Sp
 
1852
\&\fB\-baao\fR or \fB\-\-break\-after\-all\-operators\fR,
 
1853
.Sp
 
1854
\&\fB\-bbao\fR or \fB\-\-break\-before\-all\-operators\fR.
 
1855
.Sp
 
1856
The \-baao sets the default to be to break after all of the following operators:
 
1857
.Sp
 
1858
.Vb 2
 
1859
\&    % + \- * / x != == >= <= =~ !~ < > | & 
 
1860
\&    = **= += *= &= <<= &&= \-= /= |= >>= ||= //= .= %= ^= x=
 
1861
.Ve
 
1862
.Sp
 
1863
and the \fB\-bbao\fR flag sets the default to break before all of these operators.
 
1864
These can be used to define an initial break preference which can be fine-tuned
 
1865
with the \fB\-wba\fR and \fB\-wbb\fR flags.  For example, to break before all operators
 
1866
except an \fB=\fR one could use \-\-bbao \-wba='=' rather than listing every
 
1867
single perl operator except \fB=\fR on a \-wbb flag.
1843
1868
.Sh "Controlling List Formatting"
1844
1869
.IX Subsection "Controlling List Formatting"
1845
1870
Perltidy attempts to place comma-separated arrays of values in tables
1996
2021
maximum extent possible.  This will tend to produce the longest possible
1997
2022
containers, regardless of type, which do not exceed the line length
1998
2023
limit.
 
2024
.IP "\fB\-kis\fR,  \fB\-\-keep\-interior\-semicolons\fR" 4
 
2025
.IX Item "-kis,  --keep-interior-semicolons"
 
2026
Use the \fB\-kis\fR flag to prevent breaking at a semicolon if
 
2027
there was no break there in the input flag.  Normally
 
2028
perltidy places a newline after each semicolon which
 
2029
terminates a statement unless several statements are
 
2030
contained within a one-line brace block.  To illustrate,
 
2031
consider the following input lines:
 
2032
.Sp
 
2033
.Vb 2
 
2034
\&    dbmclose(%verb_delim); undef %verb_delim;
 
2035
\&    dbmclose(%expanded); undef %expanded;
 
2036
.Ve
 
2037
.Sp
 
2038
The default is to break after each statement, giving
 
2039
.Sp
 
2040
.Vb 4
 
2041
\&    dbmclose(%verb_delim);
 
2042
\&    undef %verb_delim;
 
2043
\&    dbmclose(%expanded);
 
2044
\&    undef %expanded;
 
2045
.Ve
 
2046
.Sp
 
2047
With \fBperltidy \-kis\fR the multiple statements are retained:
 
2048
.Sp
 
2049
.Vb 2
 
2050
\&    dbmclose(%verb_delim); undef %verb_delim;
 
2051
\&    dbmclose(%expanded);   undef %expanded;
 
2052
.Ve
 
2053
.Sp
 
2054
The statements are still subject to the specified value
 
2055
of \fBmaximum-line-length\fR and will be broken if this 
 
2056
maximum is exceeed.
1999
2057
.Sh "Blank Line Control"
2000
2058
.IX Subsection "Blank Line Control"
2001
2059
Blank lines can improve the readability of a script if they are carefully
2645
2703
\& dwrs dws f    fll  frm  fs  hsc html ibc  icb  icp iob  isbc lal  log
2646
2704
\& lp   lsl ohbr okw  ola  oll opr opt  osbr otr  ple ple  pod  pvl  q
2647
2705
\& sbc  sbl schb scp  scsb sct se  sfp  sfs  skp  sob sohb sop  sosb sot
2648
 
\& ssc  st  sts  syn  t    tac tbc toc  tp   tqw  tsc w    x    bar
 
2706
\& ssc  st  sts  syn  t    tac tbc toc  tp   tqw  tsc w    x    bar  kis
2649
2707
.Ve
2650
2708
.PP
2651
2709
Equivalently, the prefix 'no' or 'no\-' on the corresponding long names may be
2704
2762
\&\fIperlstyle\fR\|(1), \fIPerl::Tidy\fR\|(3)
2705
2763
.SH "VERSION"
2706
2764
.IX Header "VERSION"
2707
 
This man page documents perltidy version 20070508.
 
2765
This man page documents perltidy version 20070801.
2708
2766
.SH "CREDITS"
2709
2767
.IX Header "CREDITS"
2710
2768
Michael Cartmell supplied code for adaptation to \s-1VMS\s0 and helped with