diff --git a/lib/thin/runner.rb b/lib/thin/runner.rb index 1933f8ab..21dab052 100644 --- a/lib/thin/runner.rb +++ b/lib/thin/runner.rb @@ -92,7 +92,7 @@ def parser opts.separator "Cluster options:" opts.on("-s", "--servers NUM", "Number of servers to start") { |num| @options[:servers] = num.to_i } - opts.on("-o", "--only NUM", "Send command to only one server of the cluster") { |only| @options[:only] = only } + opts.on("-o", "--only NUM", "Send command to only one server of the cluster") { |only| @options[:only] = only.to_i } opts.on("-C", "--config FILE", "Load options from config file") { |file| @options[:config] = file } opts.on( "--all [DIR]", "Send command to each config files in DIR") { |dir| @options[:all] = dir } if Thin.linux? end diff --git a/spec/runner_spec.rb b/spec/runner_spec.rb index 844f1335..57328915 100644 --- a/spec/runner_spec.rb +++ b/spec/runner_spec.rb @@ -2,10 +2,11 @@ describe Runner do it "should parse options" do - runner = Runner.new(%w(start --pid test.pid --port 5000)) + runner = Runner.new(%w(start --pid test.pid --port 5000 -o 3000)) runner.options[:pid].should == 'test.pid' runner.options[:port].should == 5000 + runner.options[:only].should == 3000 end it "should parse specified command" do @@ -164,4 +165,4 @@ runner.run! end -end \ No newline at end of file +end