Skip to content

Commit

Permalink
Fix 'rails server -h' double help banner. Correct its usage line. [#3874
Browse files Browse the repository at this point in the history
 status:resolved]

Signed-off-by: José Valim <jose.valim@gmail.com>
  • Loading branch information
henrik authored and josevalim committed Feb 6, 2010
1 parent 22c0390 commit 95b63c6
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion railties/lib/rails/commands/server.rb
Expand Up @@ -9,6 +9,7 @@ def parse!(args)
options = {}
args = args.dup
opt_parser = OptionParser.new do |opts|
opts.banner = "Usage: rails server [options]"
opts.on("-p", "--port=port", Integer,
"Runs Rails on the specified port.", "Default: #{options[:Port]}") { |v| options[:Port] = v }
opts.on("-b", "--binding=ip", String,
Expand Down Expand Up @@ -48,7 +49,9 @@ def start

super
ensure
puts 'Exiting' unless options[:daemonize]
# The '-h' option calls exit before @options is set.
# If we call 'options' with it unset, we get double help banners.
puts 'Exiting' unless @options && options[:daemonize]
end

def middleware
Expand Down

0 comments on commit 95b63c6

Please sign in to comment.