[Groonga-commit] groonga/groonga-query-log at 2fc854d [master] Support help message

Back to archive index

Kouhei Sutou null+****@clear*****
Mon Jun 2 17:27:22 JST 2014


Kouhei Sutou	2014-06-02 17:27:22 +0900 (Mon, 02 Jun 2014)

  New Revision: 2fc854df042f2dc595cfaf0d75afe9d90378680f
  https://github.com/groonga/groonga-query-log/commit/2fc854df042f2dc595cfaf0d75afe9d90378680f

  Message:
    Support help message

  Modified files:
    lib/groonga/query-log/command/format-regression-test-logs.rb

  Modified: lib/groonga/query-log/command/format-regression-test-logs.rb (+10 -2)
===================================================================
--- lib/groonga/query-log/command/format-regression-test-logs.rb    2014-06-02 17:08:39 +0900 (d00eb4c)
+++ lib/groonga/query-log/command/format-regression-test-logs.rb    2014-06-02 17:27:22 +0900 (e87ab6a)
@@ -18,8 +18,11 @@ require "English"
 require "find"
 require "tempfile"
 require "pp"
+require "optparse"
 require "json"
 
+require "groonga/query-log/version"
+
 module Groonga
   module QueryLog
     module Command
@@ -28,10 +31,15 @@ module Groonga
         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)
-------------- next part --------------
HTML����������������������������...
Download 



More information about the Groonga-commit mailing list
Back to archive index