From 73b3eea149c9ad96985e056fe4cd692298734084 Mon Sep 17 00:00:00 2001 From: Jan Tattermusch Date: Thu, 15 Oct 2015 17:52:06 -0700 Subject: accept --use_tls=true and --use_test_ca=true in ruby --- src/ruby/pb/test/client.rb | 9 +++++---- src/ruby/pb/test/server.rb | 5 +++-- 2 files changed, 8 insertions(+), 6 deletions(-) (limited to 'src/ruby/pb') diff --git a/src/ruby/pb/test/client.rb b/src/ruby/pb/test/client.rb index 164e304b4d..e6d5223272 100755 --- a/src/ruby/pb/test/client.rb +++ b/src/ruby/pb/test/client.rb @@ -424,12 +424,13 @@ def parse_args test_case_list = test_cases.join(',') opts.on('--test_case CODE', test_cases, {}, 'select a test_case', " (#{test_case_list})") { |v| args['test_case'] = v } - opts.on('-s', '--use_tls', 'require a secure connection?') do |v| - args['secure'] = v + opts.on('--use_tls USE_TLS', ['false', 'true'], + 'require a secure connection?') do |v| + args['secure'] = v == 'true' end - opts.on('-t', '--use_test_ca', + opts.on('--use_test_ca USE_TEST_CA', ['false', 'true'], 'if secure, use the test certificate?') do |v| - args['use_test_ca'] = v + args['use_test_ca'] = v == 'true' end end.parse! _check_args(args) diff --git a/src/ruby/pb/test/server.rb b/src/ruby/pb/test/server.rb index 32934f70ad..25c1b1e9e6 100755 --- a/src/ruby/pb/test/server.rb +++ b/src/ruby/pb/test/server.rb @@ -168,8 +168,9 @@ def parse_options opts.on('--port PORT', 'server port') do |v| options['port'] = v end - opts.on('-s', '--use_tls', 'require a secure connection?') do |v| - options['secure'] = v + opts.on('--use_tls USE_TLS', ['false', 'true'], + 'require a secure connection?') do |v| + options['secure'] = v == 'true' end end.parse! -- cgit v1.2.3