Changed -o foo.bar so that it only implies -i bar if -i has not also been v0.2
authorChip Black <bytex64@bytex64.net>
Tue, 3 Jun 2008 06:02:45 +0000 (01:02 -0500)
committerChip Black <bytex64@bytex64.net>
Tue, 3 Jun 2008 06:02:45 +0000 (01:02 -0500)
specified.

conv.pl

diff --git a/conv.pl b/conv.pl
index 2293a36..6180d0f 100755 (executable)
--- 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;