commit:9c192a57c8b3c2233d12a7fe198db31bc6706aa5
author:Chip Black
committer:Chip Black
date:Sat Aug 16 16:00:28 2014 -0500
parents:feb98acbdff7690dee8fc9f6ccc23302f7d56cc9
Add $* for filename base
diff --git a/README b/README
line changes: +4/-3
index 98db032..95bfcc7
--- a/README
+++ b/README
@@ -102,9 +102,10 @@ line in a Convfile is either blank, or one of two types:
   Which says "Convert files with extension 'foo' to a file with
   extension 'bar' using program 'program'.  $< and $@ mean "input" and
   "output," respectively, and are substituted with the input and output
-  filenames, just like make does.  Note that conv considers an extension
-  to be made up of letters and numbers ONLY.  If this isn't sufficient,
-  go hack the regex yourself.  :P
+  filenames, just like make does.  There is also the $* variable for the
+  name of the file without the extension.  Note that conv considers an
+  extension to be made up of letters and numbers ONLY.  If this isn't
+  sufficient, go hack the regex yourself.  :P
 
 * A variable declaration, which looks like:
 

diff --git a/conv.pl b/conv.pl
line changes: +1/-0
index 50d205d..5904405
--- a/conv.pl
+++ b/conv.pl
@@ -38,6 +38,7 @@ sub convert {
     my $infile = "$base.$iext";
     $infile =~ s/"/\\"/g;
     $cmd =~ s!\$\<!"$infile"!g;
+    $cmd =~ s!\$\*!"$base"!g;
     my $outfile;
     if ($opts{o}) {
         if ($dirout) {