[Groonga-commit] ranguba/groonga-client at 290054f [master] groonga-client: add --url option

Back to archive index

Kouhei Sutou null+****@clear*****
Wed Oct 25 16:50:46 JST 2017


Kouhei Sutou	2017-10-25 16:50:46 +0900 (Wed, 25 Oct 2017)

  New Revision: 290054f3892c8ca14ab3649bdd5228b97cdb2678
  https://github.com/ranguba/groonga-client/commit/290054f3892c8ca14ab3649bdd5228b97cdb2678

  Message:
    groonga-client: add --url option

  Modified files:
    lib/groonga/client/command-line/groonga-client.rb

  Modified: lib/groonga/client/command-line/groonga-client.rb (+10 -1)
===================================================================
--- lib/groonga/client/command-line/groonga-client.rb    2017-10-25 16:07:24 +0900 (e93b85d)
+++ lib/groonga/client/command-line/groonga-client.rb    2017-10-25 16:50:46 +0900 (e5f4d8d)
@@ -27,6 +27,7 @@ module Groonga
     module CommandLine
       class GroongaClient
         def initialize
+          @url      = nil
           @protocol = :http
           @host     = "localhost"
           @port     = nil
@@ -44,7 +45,8 @@ module Groonga
         def run(argv)
           command_file_paths = parse_command_line(argv)
 
-          @client = Client.new(:protocol => @protocol,
+          @client = Client.new(:url      => @url,
+                               :protocol => @protocol,
                                :host     => @host,
                                :port     => @port,
                                :read_timeout => @read_timeout,
@@ -85,6 +87,13 @@ module Groonga
 
           parser.separator("Connection:")
 
+          parser.on("--url=URL",
+                    "URL to connect to Groonga server.",
+                    "If this option is specified,",
+                    "--protocol, --host and --port are ignored.") do |url|
+            @url = url
+          end
+
           available_protocols = [:http, :gqtp]
           parser.on("--protocol=PROTOCOL", [:http, :gqtp],
                     "Protocol to connect to Groonga server.",
-------------- next part --------------
HTML����������������������������...
URL: https://lists.osdn.me/mailman/archives/groonga-commit/attachments/20171025/17714d2a/attachment-0001.htm 



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