[Groonga-commit] groonga/groonga-query-log at f2a95ca [master] analyzer: handle option error

Back to archive index

Kouhei Sutou null+****@clear*****
Thu Dec 7 11:58:43 JST 2017


Kouhei Sutou	2017-12-07 11:58:43 +0900 (Thu, 07 Dec 2017)

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

  Message:
    analyzer: handle option error

  Modified files:
    lib/groonga-query-log/command/analyzer.rb

  Modified: lib/groonga-query-log/command/analyzer.rb (+6 -1)
===================================================================
--- lib/groonga-query-log/command/analyzer.rb    2017-12-07 11:55:48 +0900 (2a3cd04)
+++ lib/groonga-query-log/command/analyzer.rb    2017-12-07 11:58:43 +0900 (bb4e14b)
@@ -61,7 +61,12 @@ module GroongaQueryLog
       #   groonga-query-log-analyze. Please execute
       #   "groonga-query-log-analyze --help" or see #setup_options.
       def run(arguments)
-        log_paths = @option_parser.parse!(arguments)
+        begin
+          log_paths = @option_parser.parse!(arguments)
+        rescue OptionParser::InvalidOption => error
+          $stderr.puts(error)
+          return false
+        end
 
         stream = @options[:stream]
         dynamic_sort = @options[:dynamic_sort]
-------------- next part --------------
HTML����������������������������...
URL: https://lists.osdn.me/mailman/archives/groonga-commit/attachments/20171207/cd3ac259/attachment-0001.htm 



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