]> git.donarmstrong.com Git - perltidy.git/commitdiff
add example for -iob
authorSteve Hancock <perltidy@users.sourceforge.net>
Tue, 26 Oct 2021 13:49:22 +0000 (06:49 -0700)
committerSteve Hancock <perltidy@users.sourceforge.net>
Tue, 26 Oct 2021 13:49:22 +0000 (06:49 -0700)
bin/perltidy

index e7f1ceaceb3082bd3bcf9a18a08d6c8c7d0ee9a5..22ee4002a032a18d9e6f30e64d26589b10b74c8d 100755 (executable)
@@ -3465,9 +3465,35 @@ For example, given the script:
 Use this flag to tell perltidy to ignore existing line breaks to the
 maximum extent possible.  This will tend to produce the longest possible
 containers, regardless of type, which do not exceed the line length
-limit. But please note that this parameter has priority over all
+limit.  But please note that this parameter has priority over all
 other parameters requesting that certain old breakpoints be kept.
 
+To illustrate, consider the following input text:
+
+    has subcmds => (
+        is => 'ro',
+        default => sub { [] },
+    );
+
+The default formatting will keep the container broken, giving
+
+    # perltidy [default]
+    has subcmds => (
+        is      => 'ro',
+        default => sub { [] },
+    );
+
+If old breakpoints are ignored, the list will be flattened:
+
+    # perltidy -iob
+    has subcmds => ( is => 'ro', default => sub { [] }, );
+
+Besides flattening lists, this parameter also applies to lines broken
+at certain logical breakpoints such as 'if' and 'or'.
+
+The length of the lines produced in this way are only limited by the
+value of the parameter B<--maximum-line-length>.
+
 =item B<-kis>,  B<--keep-interior-semicolons>
 
 Use the B<-kis> flag to prevent breaking at a semicolon if