aboutsummaryrefslogtreecommitdiffstats
path: root/railties
diff options
context:
space:
mode:
authorHenrik N <henrik@nyh.se>2010-02-06 12:48:02 +0100
committerJosé Valim <jose.valim@gmail.com>2010-02-06 13:03:52 +0100
commit95b63c6a078527b747c99ab1c881fdfe6577518b (patch)
treea33e3a2db465494e267802db0400e344438c0de4 /railties
parent22c0390085eed6fa2c4b78e1a9465ae3b7861568 (diff)
downloadrails-95b63c6a078527b747c99ab1c881fdfe6577518b.tar.gz
rails-95b63c6a078527b747c99ab1c881fdfe6577518b.tar.bz2
rails-95b63c6a078527b747c99ab1c881fdfe6577518b.zip
Fix 'rails server -h' double help banner. Correct its usage line. [#3874 status:resolved]
Signed-off-by: José Valim <jose.valim@gmail.com>
Diffstat (limited to 'railties')
-rw-r--r--railties/lib/rails/commands/server.rb5
1 files changed, 4 insertions, 1 deletions
diff --git a/railties/lib/rails/commands/server.rb b/railties/lib/rails/commands/server.rb
index b21ae2a17b..c27214d3c8 100644
--- a/railties/lib/rails/commands/server.rb
+++ b/railties/lib/rails/commands/server.rb
@@ -9,6 +9,7 @@ module Rails
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 @@ module Rails
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