Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fix error when using only options
  • Loading branch information
hasimo committed Mar 4, 2009
1 parent 0e20e43 commit 1a821af
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/thin/runner.rb
Expand Up @@ -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
Expand Down
5 changes: 3 additions & 2 deletions spec/runner_spec.rb
Expand Up @@ -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
Expand Down Expand Up @@ -164,4 +165,4 @@

runner.run!
end
end
end

0 comments on commit 1a821af

Please sign in to comment.