From 880d42fa8c2f5406b9496a5a1d17aa2692920802 Mon Sep 17 00:00:00 2001 From: Steve Hancock Date: Fri, 18 Sep 2020 07:32:37 -0700 Subject: [PATCH] updated docs for -ihb -isb -ip --- bin/perltidy | 55 +++++++++++++++++++++++++++++++++++++++++++++- docs/perltidy.html | 55 +++++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 108 insertions(+), 2 deletions(-) diff --git a/bin/perltidy b/bin/perltidy index ae586164..a0e34d29 100755 --- a/bin/perltidy +++ b/bin/perltidy @@ -2179,10 +2179,45 @@ this parameter has no effect. =item * -Similar flags for controlling parens and square brackets are given in the next section. +The indentation of the braces will normally be one level of continuation +indentation by default. This can be changed with the parameter +B<--indent-hash-brace=n> in the next section. + +=item * + +Similar flags for controlling parens and square brackets are given in the subsequent section. =back +=item B<-ihb=n>, B<--indent-hash-brace=n> + +This flag is a companion to B<-bbhb> for controlling the indentation of an opening hash brace. +The indentation is as follows: + + -ihb=0 one continuation level [default] + -ihb=1 outdent by one continuation level + -ihb=2 indent one full indentation level + +For example: + + # perltidy -bbhb=3 -ihb=1 + $romanNumerals = + { + one => 'I', + two => 'II', + three => 'III', + four => 'IV', + }; + + # perltidy -bbhb=3 -ihb=2 + $romanNumerals = + { + one => 'I', + two => 'II', + three => 'III', + four => 'IV', + }; + =item B<-bbsb=n>, B<--break-before-square-bracket=n> This flag is similar to the flag described above, except it applies to square brackets. @@ -2192,6 +2227,15 @@ This flag is similar to the flag described above, except it applies to square br -bbsb=2 break if list is 'complex', meaning it contains other broken lists -bbsb=3 always break +=item B<-isb=n>, B<--indent-square-bracket=n> + +This flag is a companion to B<-bbsb> for controlling the indentation of an opening square bracket. +The indentation is as follows: + + -isb=0 one continuation level [default] + -isb=1 outdent by one continuation level + -isb=2 indent one full indentation level + =item B<-bbp=n>, B<--break-before-paren=n> This flag is similar to B<-bbhb=n>, described above, except it applies to parens. @@ -2201,6 +2245,15 @@ This flag is similar to B<-bbhb=n>, described above, except it applies to parens -bbp=2 break if list is 'complex', meaning it contains other broken lists -bbp=3 always break +=item B<-ip=n>, B<--indent-paren=n> + +This flag is a companion to B<-bbp> for controlling the indentation of an opening paren. +The indentation is as follows: + + -ip=0 one continuation level [default] + -ip=1 outdent by one continuation level + -ip=2 indent one full indentation level + =item B<-wn>, B<--weld-nested-containers> diff --git a/docs/perltidy.html b/docs/perltidy.html index 91e3243d..806eba17 100644 --- a/docs/perltidy.html +++ b/docs/perltidy.html @@ -1719,11 +1719,44 @@
  • If multiple opening tokens have been 'welded' together with the -wn parameter, then this parameter has no effect.

  • -
  • Similar flags for controlling parens and square brackets are given in the next section.

    +
  • The indentation of the braces will normally be one level of continuation indentation by default. This can be changed with the parameter --indent-hash-brace=n in the next section.

    + +
  • +
  • Similar flags for controlling parens and square brackets are given in the subsequent section.

  • + +
    -ihb=n, --indent-hash-brace=n
    +
    + +

    This flag is a companion to -bbhb for controlling the indentation of an opening hash brace. The indentation is as follows:

    + +
      -ihb=0 one continuation level [default]
    +  -ihb=1 outdent by one continuation level
    +  -ihb=2 indent one full indentation level
    + +

    For example:

    + +
        # perltidy -bbhb=3 -ihb=1
    +    $romanNumerals =
    +    {
    +        one   => 'I',
    +        two   => 'II',
    +        three => 'III',
    +        four  => 'IV',
    +    };
    +
    +    # perltidy -bbhb=3 -ihb=2
    +    $romanNumerals =
    +        {
    +        one   => 'I',
    +        two   => 'II',
    +        three => 'III',
    +        four  => 'IV',
    +        };
    +
    -bbsb=n, --break-before-square-bracket=n
    @@ -1735,6 +1768,16 @@ -bbsb=2 break if list is 'complex', meaning it contains other broken lists -bbsb=3 always break +
    +
    -isb=n, --indent-square-bracket=n
    +
    + +

    This flag is a companion to -bbsb for controlling the indentation of an opening square bracket. The indentation is as follows:

    + +
      -isb=0 one continuation level [default]
    +  -isb=1 outdent by one continuation level
    +  -isb=2 indent one full indentation level
    +
    -bbp=n, --break-before-paren=n
    @@ -1746,6 +1789,16 @@ -bbp=2 break if list is 'complex', meaning it contains other broken lists -bbp=3 always break +
    +
    -ip=n, --indent-paren=n
    +
    + +

    This flag is a companion to -bbp for controlling the indentation of an opening paren. The indentation is as follows:

    + +
      -ip=0 one continuation level [default]
    +  -ip=1 outdent by one continuation level
    +  -ip=2 indent one full indentation level
    +
    -wn, --weld-nested-containers
    -- 2.39.5