Permalink
Browse files

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
  • Loading branch information...
1 parent 416385a commit aced2863f0c76169692287c36bf384e3abc35e3b @dhh dhh committed Mar 18, 2006
Showing with 5 additions and 4 deletions.
  1. +5 −4 railties/lib/commands/servers/lighttpd.rb
@@ -15,9 +15,13 @@
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 @@
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

0 comments on commit aced286

Please sign in to comment.