From 10cf9f9f39c2ec0d5d79eccbd0ddea510ef9a121 Mon Sep 17 00:00:00 2001 From: Tommy Reynolds Date: Thu, 15 Dec 2005 05:42:45 +0000 Subject: Cleaned up tacky if-series into an elegant if-elsif checklist ;-) --- bin/xmldiff.pl | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) (limited to 'bin') diff --git a/bin/xmldiff.pl b/bin/xmldiff.pl index 0e59561..6b358e5 100644 --- a/bin/xmldiff.pl +++ b/bin/xmldiff.pl @@ -1,12 +1,12 @@ #!/usr/bin/perl # # Copyright (c) 2002, DecisionSoft Limited All rights reserved. -# Please see: -# http://software.decisionsoft.com/licence.html +# Please see: +# http://software.decisionsoft.com/licence.html # for more information. # # Modified for the Fedora Docs Project by Tommy.Reynolds@MegaCoder.com -# +# # # xmldiff: xmldiff program - uses xmlpp, which must be on the ${PATH} @@ -37,29 +37,24 @@ if( $outputFmt > 1 ) { if( $opt_s ) { # Standard diff, no playing around -} -if ( $opt_c ) { +} elsif( $opt_c ) { # Plain context diff $diffOpts .= "-c "; -} -if( $opt_u ) { +} elsif( $opt_u ) { # Plain unified diff $diffOpts .= "-u "; -} -if( $opt_p ) { +} elsif( $opt_p ) { # Colorized unified diff # $diffOpts .= "-u "; $diffOpts .= "--new-line-format='+ %l\n' "; $diffOpts .= "--old-line-format='- %l\n' "; $diffOpts .= "--unchanged-line-format=' %l\n' "; -} -if( $opt_C ) { +} elsif( $opt_C ) { $diffOpts .= "--changed-group-format='\n<<<<<<<<<<<<<<\n%<==============\n%>>>>>>>>>>>>>>>\n\n' "; $diffOpts .= "--new-line-format='+ %l\n' "; $diffOpts .= "--old-line-format='- %l\n' "; $diffOpts .= "--unchanged-line-format=' %l\n' "; -} -if( $opt_H ) { +} elsif( $opt_H ) { $diffOpts .= "--changed-group-format='%<%>' "; $diffOpts .= " --new-group-format='%>' "; $diffOpts .= "--old-group-format='%<' "; -- cgit