lib/ssltransportagent.rb
# this method parses the command line options
this method parses the command line options
this method parses the command line options
def process_options
    options = OpenStruct.new
    options.log = Logger::INFO
    options.daemon = false
    begin
      OptionParser.new do |opts|
        opts.on("--debug",  "Log all messages")     { |v| options.log = Logger::DEBUG }
        opts.on("--info",   "Log all messages")     { |v| options.log = Logger::INFO }
        opts.on("--warn",   "Log all messages")     { |v| options.log = Logger::WARN }
        opts.on("--error",  "Log all messages")     { |v| options.log = Logger::ERROR }
        opts.on("--fatal",  "Log all messages")     { |v| options.log = Logger::FATAL }
        opts.on("--daemon", "Run as system daemon") { |v| options.daemon = true }
      end.parse!
    rescue OptionParser::InvalidOption => e
      @log.warn("%06d"%Process::pid) {"#{e.inspect}"}
    end
    options
  end
def process_options options = OpenStruct . new options . log = Logger :: INFO options . daemon = false begin OptionParser . new do | opts | opts . on ( "--debug" , "Log all messages" ) { | v | options . log = Logger :: DEBUG } opts . on ( "--info" , "Log all messages" ) { | v | options . log = Logger :: INFO } opts . on ( "--warn" , "Log all messages" ) { | v | options . log = Logger :: WARN } opts . on ( "--error" , "Log all messages" ) { | v | options . log = Logger :: ERROR } opts . on ( "--fatal" , "Log all messages" ) { | v | options . log = Logger :: FATAL } opts . on ( "--daemon" , "Run as system daemon" ) { | v | options . daemon = true } end . parse! rescue OptionParser :: InvalidOption => e @log . warn ( "%06d" % Process :: pid ) { "#{e.inspect}" } end options end
this method parses the command line options
this method parses the command line options