more thoughts on the new config file
[god.git] / bin / god
blob71179edc1e84000409e20dad616a8984e874562c
1 #!/usr/bin/env ruby
3 $:.unshift File.join(File.dirname(__FILE__), *%w[.. lib])
5 require 'rubygems'
6 require 'daemons'
7 require 'optparse'
8 require 'god'
10 options = {}
11 OptionParser.new do |opts|
12 opts.banner = "Usage: god command [options]"
14 opts.on("-cCONFIG", "--config-file CONFIG", "Configuration file") do |x|
15 options[:config] = x
16 end
17 end.parse!
19 options[:config] = File.expand_path(options[:config]) if options[:config]
21 # p options
22 # p ARGV
24 Daemons.run_proc('god') do
25 load options[:config]
26 end