Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fix 'rails server -h' double help banner. Correct its usage line. [#3874

 status:resolved]

Signed-off-by: José Valim <jose.valim@gmail.com>
  • Loading branch information...
commit 95b63c6a078527b747c99ab1c881fdfe6577518b 1 parent 22c0390
@henrik henrik authored josevalim committed
Showing with 4 additions and 1 deletion.
  1. +4 −1 railties/lib/rails/commands/server.rb
View
5 railties/lib/rails/commands/server.rb
@@ -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,
@@ -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
Please sign in to comment.
Something went wrong with that request. Please try again.