#!/usr/bin/env ruby require 'drbqs' require 'optparse' Version = '0.0.1' help_message =< [other files ...] [options ...] #{File.basename(__FILE__)} [other files ...] [options ...] -- [server options ...] Start DRbQS server of definition files. HELP options = { :log_file => STDOUT, :command_type => :server_start, :acl => DRbQS::Config.get_acl_file } command_argv, server_argv = DRbQS::Manage.split_arguments(ARGV) begin OptionParser.new(help_message) do |opt| opt.on('-p PORT', '--port', Integer, 'Set the port number of server.') do |v| options[:port] = v end opt.on('--acl FILE', String, 'Set a file to define ACL.') do |v| options[:acl] = v end opt.on('--log-file STR', String, "Set the path of log file. If this options is not set, use STDOUT.") do |v| options[:log_file] = v end opt.on('--log-level LEVEL', String, "Set the log level. The value accepts 'fatal', 'error', 'warn', 'info', and 'debug'. The default is 'error'.") do |v| if /^(fatal)|(error)|(warn)|(info)|(debug)$/i =~ v options[:log_level] = eval("Logger::#{v.upcase}") else raise "Invalid log level." end end opt.on('--debug', 'Set $DEBUG true.') do |v| $DEBUG = true end opt.on('--test STR', String, 'Execute test.') do |v| options[:command_type] = "test_#{v}" end opt.parse!(command_argv) end rescue OptionParser::InvalidOption $stderr.print <