Navigation Menu

Skip to content

Commit

Permalink
Support help message
Browse files Browse the repository at this point in the history
  • Loading branch information
kou committed Jun 2, 2014
1 parent 85d98f6 commit 2fc854d
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions lib/groonga/query-log/command/format-regression-test-logs.rb
Expand Up @@ -18,8 +18,11 @@
require "find"
require "tempfile"
require "pp"
require "optparse"
require "json"

require "groonga/query-log/version"

module Groonga
module QueryLog
module Command
Expand All @@ -28,10 +31,15 @@ def initialize
end

def run(command_line)
if command_line.empty?
parser = OptionParser.new
parser.banner += " PATH1 PATH2 ..."
parser.version = VERSION
paths = parser.parse!(command_line)

if paths.empty?
format_log($stdin, "-")
else
command_line.each do |path|
paths.each do |path|
if File.directory?(path)
Find.find(path) do |sub_path|
next unless File.file?(sub_path)
Expand Down

0 comments on commit 2fc854d

Please sign in to comment.