def initialize
@options = {}
@parser = OptionParser.new do |opts|
opts.banner = "Usage: #{File.basename($0)} [command] [options]"
opts.separator ""
opts.separator "Command is one of the following:"
opts.separator " run - Run the daemon without forking (default)"
opts.separator " start - Run the daemon"
opts.separator " stop - Stop the running daemon"
opts.separator ""
opts.separator "Options can be:"
arg_file = File.join( DaemonKit.root, 'config', 'arguments.rb' )
eval(IO.read(arg_file), binding, arg_file) if File.exists?( arg_file )
opts.on("-e", "--env ENVIRONMENT", "Environment for the process", "Defaults to development") do
end
opts.on("--pidfile PATH", "Path to the pidfile", "Defaults to log/#{DaemonKit.configuration.daemon_name}.pid") do
end
opts.on("-l", "--log /path/to/logfile", "Path to the log file", "Defaults to log/[environment].log") do
end
opts.separator ""
opts.separator "Advanced configurations:"
opts.on("--config ATTRIBUTE=VALUE",
"Change values of the daemon-kit Configuration instance",
"Example: log_dir=/path/to/log-directory") do
end
opts.separator ""
opts.separator "Common options:"
opts.on("-v", "--version", "Show version information and exit") do
puts "daemon-kit #{DaemonKit::VERSION} (http://github.com/kennethkalmer/daemon-kit)"
exit
end
opts.on_tail("-h", "--help", "Show this message") do
puts opts
exit
end
end
end