From 6ca753ce2e0a81454cf0fe549a113f8250e8ff3c Mon Sep 17 00:00:00 2001 From: Henrik N Date: Sat, 6 Feb 2010 12:48:02 +0100 Subject: [PATCH] Fix 'rails server -h' double help banner. Correct its usage line. --- railties/lib/rails/commands/server.rb | 5 ++++- 1 files changed, 4 insertions(+), 1 deletions(-) diff --git a/railties/lib/rails/commands/server.rb b/railties/lib/rails/commands/server.rb index b21ae2a..9347ab6 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: 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 -- 1.6.4.2