mirror of
https://github.com/github/rails.git
synced 2026-01-30 16:58:15 -05:00
Fix the detach option for lighttp (closes #4097) [schultzr@gmail.com]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3933 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
This commit is contained in:
@@ -15,9 +15,13 @@ configuration = Rails::Initializer.run(:initialize_logger).configuration
|
||||
default_config_file = config_file = "#{RAILS_ROOT}/config/lighttpd.conf"
|
||||
|
||||
require 'optparse'
|
||||
|
||||
detach = false
|
||||
|
||||
ARGV.options do |opt|
|
||||
opt.on('-c', "--config=#{config_file}", 'Specify a different lighttpd config file.') { |path| config_file = path }
|
||||
opt.on('-h', '--help', 'Show this message.') { puts opt; exit 0 }
|
||||
opt.on('-d', '-d', 'Call with -d to detach') { detach = true; puts "=> Configuration in config/lighttpd.conf" }
|
||||
opt.parse!
|
||||
end
|
||||
|
||||
@@ -43,10 +47,7 @@ puts "=> Rails application started on http://#{ip || default_ip}:#{port || defau
|
||||
|
||||
tail_thread = nil
|
||||
|
||||
if ARGV.first == "-d"
|
||||
puts "=> Configuration in config/lighttpd.conf"
|
||||
detach = true
|
||||
else
|
||||
if !detach
|
||||
puts "=> Call with -d to detach"
|
||||
puts "=> Ctrl-C to shutdown server (see config/lighttpd.conf for options)"
|
||||
detach = false
|
||||
|
||||
Reference in New Issue
Block a user