OSDN Git Service

test_not_uchifuzume was not erronously executed. Now the method is tested.
[shogi-server/shogi-server.git] / mk_rate
diff --git a/mk_rate b/mk_rate
index 568c4f4..dff3977 100755 (executable)
--- a/mk_rate
+++ b/mk_rate
@@ -726,8 +726,15 @@ def main
   $options["half-life-ignore"] = $options["half-life-ignore"].to_i
   $options["fixed-rate"] = $options["fixed-rate"].to_i if $options["fixed-rate"]
 
-  while dir = ARGV.shift do
-    Dir.glob( File.join(dir, "**", "*.csa") ) {|f| grep(f)}
+  if ARGV.empty?
+    while line = $stdin.gets do
+      next unless %r!.*\.csa$! =~ line
+      grep line.strip
+    end
+  else
+    while dir = ARGV.shift do
+      Dir.glob( File.join(dir, "**", "*.csa") ) {|f| grep(f)}
+    end
   end
 
   yaml = {}