Subject: | Suggested enhancement and alignment within an "if" condition bug in Perl-Tidy |
Date: | Mon, 12 May 2008 17:07:38 -0500 |
To: | <bug-perl-tidy [...] rt.cpan.org> |
From: | "Neargarder, Keith" <Keith.Neargarder [...] USA.GKNAEROSPACE.COM> |
First want to say what a fan I am of Perl-Tidy - it is really awesome. I
am the standards guy with my group and Perl-Tidy makes it so easy to
keep everyone is line with our Perl programming standards.
Minor suggested enhancement: addition of command line option "-?" to
display help info. Also I prefer to exit with a zero status when one
simply requests the help/usage - here is a snippet of what I changed in
the Perltidy script I am using (obviously I could have just added \? to
the list of matches in the first elsif below):
elsif ( $i =~ /^-(help|h|HELP|H)$/ ) {
usage();
# keith - beg
# exit 1;
exit 0;
}
elsif ( $i =~ /^-\?$/ ) {
usage();
exit 0;
# keith - end
}
elsif ( $i =~ /^-(version|v)$/ ) {
show_version();
exit 1;
}
System info:
Show quoted text
neargark> uname -a
HP-UX cinstl01 B.11.11 U 9000/800 2502247198 unlimited-user license
Show quoted textneargark> perl -v
This is perl, v5.8.8 built for PA-RISC2.0-thread-multi-LP64
(with 26 registered patches, see perl -V for more detail)
Copyright 1987-2006, Larry Wall
Binary build 817 [257965] provided by ActiveState
http://www.ActiveState.com
Built Mar 20 2006 20:44:24
Was using Perl-Tidy version 1.64; upgraded to version 1.73 when I first
found the problem hoping the latest release may have addressed the issue
but still get the problem.
.perltidyrc file being used:
# perltidy configuration file
--indent-columns=2
--short-concatenation-item-length=2
--backup-and-modify-in-place
--backup-file-extension=old
snippet of Perl code formatted with Perltidy with what I believe is a
bug (I am expecting all the "eq $rec" to line up):
if ( $sfcr{trns_code} eq $rec[0]
and $sfcr{ord_nbr} eq $rec[ $fld{OrdNbr} ]
and $sfcr{sub_ord_nbr} eq $rec[ $fld{SubOrdNbr} ]
and $sfcr{seq_nbr} eq $rec[ $fld{SeqNbr} ] )
{
$new_error = $rec[ $fld{msg_id} ];
last;
}