Perltidy总是打印到标准输出

问题描述 投票:2回答:1

我的Perltidy始终打印到标准输出而不是默认的test.pl.tdy

perltidy test.pl

这是我的.perltidyrc

-pbp # Start with Perl Best Practices
-w
-l=100   # 100 characters per line
-ce # 'cuddled' elses. elses appear on the same line as last brace
-pt=2 # no parentheses spacing
-pt=2    # High parenthesis tightness
-bt=2    # High brace tightness
-sbt=2   # High square bracket tightness
-bar # opening braces right
-nsbl # open subroutine brace on right
-bbvt=1 # Block Brace Vertical Tightness
-sot # stack opening tokens
-sct # stack closing tokens
-nsfs # no For Loop Semicolon Spaces
-nolq # don't outdent long strings

即使我这样做:

perltidy -b test.pl

它仍将打印到标准,而不是去test.pl.bak。我可以让它去另一个文件的唯一方法是:

perltidy test.pl > test.pl.tdy

我的.perltidyrc中有什么可能导致这种情况吗?我似乎找不到任何解释它的东西。

perl perl-tidy
1个回答
4
投票

文档在Styles section中说

-pbp, - pel-best-practices -pbp是Damian Conway的Perl Best Practices一书中参数的缩写:

-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="

请注意,此参数集包括-st和-se标志,这使得perltidy仅作为一个文件的过滤器。可以通过在-pbp参数后面放置-nst和/或-nse来覆盖它们。

(我的重点)相关的标志在I/O control section中描述。

我不知道为什么-pbp包含要打印到标准流的标志,这意味着必须只有一个输入文件,但可能有一个原因;因此,详细检查其下所有标志的作用可能是个好主意。

我发现-nst--nostandard-ouput)甚至在-pbp之后,在同一条线上工作。

© www.soinside.com 2019 - 2024. All rights reserved.