docs-common/bin xmldiff.pl,1.1,1.2
Tommy Reynolds (jtr)
fedora-docs-commits at redhat.com
Thu Dec 15 05:42:53 UTC 2005
Author: jtr
Update of /cvs/docs/docs-common/bin
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv6195
Modified Files:
xmldiff.pl
Log Message:
Cleaned up tacky if-series into an elegant if-elsif checklist ;-)
Index: xmldiff.pl
===================================================================
RCS file: /cvs/docs/docs-common/bin/xmldiff.pl,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- xmldiff.pl 15 Dec 2005 03:19:56 -0000 1.1
+++ xmldiff.pl 15 Dec 2005 05:42:45 -0000 1.2
@@ -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 at MegaCoder.com
-#
+#
#
# xmldiff: xmldiff program - uses xmlpp, which must be on the ${PATH}
@@ -37,29 +37,24 @@
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='[1m[33m+ %l\n[m' ";
$diffOpts .= "--old-line-format='[1m[31m- %l\n[m' ";
$diffOpts .= "--unchanged-line-format='[1m[30m %l[m\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='%<' ";
More information about the Fedora-docs-commits
mailing list