]> git.donarmstrong.com Git - perltidy.git/commitdiff
check for negative --starting-indentation-level
authorSteve Hancock <perltidy@users.sourceforge.net>
Fri, 27 Oct 2023 17:17:41 +0000 (10:17 -0700)
committerSteve Hancock <perltidy@users.sourceforge.net>
Fri, 27 Oct 2023 17:17:41 +0000 (10:17 -0700)
lib/Perl/Tidy.pm

index 0dfbdc7768f51f2b70af5d0e90c6ef40b4fbf95e..ef043b4f061701d3b61f9568079156d393833d5d 100644 (file)
@@ -4538,6 +4538,13 @@ sub check_options {
 EOM
     }
 
+    my $sil = $rOpts->{'starting-indentation-level'};
+    if ( defined($sil) && $sil < 0 ) {
+        Die(<<EOM);
+--starting-indentation-level=$sil not possible; it should be non-negative
+EOM
+    }
+
     # Since -vt, -vtc, and -cti are abbreviations, but under
     # msdos, an unquoted input parameter like vtc=1 will be
     # seen as 2 parameters, vtc and 1, so the abbreviations