commit:2787fb418e134d9653ed8d8d1de6b31ee7358c8b
author:Chip Black
committer:Chip Black
date:Tue Jun 3 01:02:45 2008 -0500
parents:b4bc84a2cdacbf8c1958e611f5383474d1b3d719
Changed -o foo.bar so that it only implies -i bar if -i has not also been
specified.
diff --git a/conv.pl b/conv.pl
line changes: +2/-2
index 2293a36..6180d0f
--- a/conv.pl
+++ b/conv.pl
@@ -17,9 +17,9 @@ if (-d $opts{o}) {
     # output is a directory
     $dirout = 1;
 } else {
-    # output is a single file, imply -i <ext>
+    # output is a single file, imply -i <ext> unless -i has also been specified
     if ($opts{o} =~ /\.(\w+)$/) {
-        $opts{i} = $1;
+        $opts{i} = $1 unless exists $opts{i};
     } else {
         print "Specified -o <file>, but '$opts{o}' has no extension.\n";
         exit 1;