[Groonga-commit] droonga/droonga-client-ruby at 55eede6 [master] Add --exit-on-response option

Back to archive index

Kouhei Sutou null+****@clear*****
Tue Jan 28 15:10:40 JST 2014


Kouhei Sutou	2014-01-28 15:10:40 +0900 (Tue, 28 Jan 2014)

  New Revision: 55eede6bc02a909e6e326fec63a71d9df8537fe9
  https://github.com/droonga/droonga-client-ruby/commit/55eede6bc02a909e6e326fec63a71d9df8537fe9

  Message:
    Add --exit-on-response option

  Modified files:
    sample/droonga-request.rb

  Modified: sample/droonga-request.rb (+7 -0)
===================================================================
--- sample/droonga-request.rb    2014-01-28 15:08:45 +0900 (eb040f4)
+++ sample/droonga-request.rb    2014-01-28 15:10:40 +0900 (9c53f2d)
@@ -24,6 +24,7 @@ options = {
   :tag                 => "droonga",
   :protocol            => :droonga,
   :timeout             => 1,
+  :exit_on_response    => true,
   :receiver_host       => "localhost",
   :receiver_port       => 0,
   :report_elapsed_time => true,
@@ -62,6 +63,11 @@ parser.on("--timeout=TIMEOUT", Integer,
           "(#{options[:timeout]})") do |timeout|
   options[:timeout] = timeout
 end
+parser.on("--[no-]exit-on-response",
+          "Exit when a response is received.",
+          "(#{options[:exit_on_response]})") do |exit_on_response|
+  options[:exit_on_response] = exit_on_response
+end
 parser.separator("")
 parser.separator("Droonga protocol:")
 parser.on("--receiver-host=HOST",
@@ -100,5 +106,6 @@ request = client.request(request_message) do |response|
   rescue
     p(response)
   end
+  break if options[:exit_on_response]
 end
 request.wait
-------------- next part --------------
HTML����������������������������...
Download 



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