diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2006-03-18 17:00:40 +0000 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2006-03-18 17:00:40 +0000 |
commit | aced2863f0c76169692287c36bf384e3abc35e3b (patch) | |
tree | c409968cd494559bb924ae7a64599fd697416a48 /railties | |
parent | 416385a09d61758ba8e2b2ff30dd64c8b9540883 (diff) | |
download | rails-aced2863f0c76169692287c36bf384e3abc35e3b.tar.gz rails-aced2863f0c76169692287c36bf384e3abc35e3b.tar.bz2 rails-aced2863f0c76169692287c36bf384e3abc35e3b.zip |
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
Diffstat (limited to 'railties')
-rw-r--r-- | railties/lib/commands/servers/lighttpd.rb | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/railties/lib/commands/servers/lighttpd.rb b/railties/lib/commands/servers/lighttpd.rb index 315fb34ade..4703ea3576 100644 --- a/railties/lib/commands/servers/lighttpd.rb +++ b/railties/lib/commands/servers/lighttpd.rb @@ -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 |