Navigation Menu

Skip to content

Commit

Permalink
groonga-client: add --url option
Browse files Browse the repository at this point in the history
  • Loading branch information
kou committed Oct 25, 2017
1 parent 92ea868 commit 290054f
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion lib/groonga/client/command-line/groonga-client.rb
Expand Up @@ -27,6 +27,7 @@ class Client
module CommandLine
class GroongaClient
def initialize
@url = nil
@protocol = :http
@host = "localhost"
@port = nil
Expand All @@ -44,7 +45,8 @@ def initialize
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,
Expand Down Expand Up @@ -85,6 +87,13 @@ def parse_command_line(argv)

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.",
Expand Down

0 comments on commit 290054f

Please sign in to comment.