class PhusionPassenger::Config::Command

Public Class Methods

new(argv) click to toggle source
# File src/ruby_supportlib/phusion_passenger/config/command.rb, line 28
def initialize(argv)
  @argv = argv.dup
  @options = self.class.create_default_options
end

Private Class Methods

create_default_options() click to toggle source
# File src/ruby_supportlib/phusion_passenger/config/command.rb, line 43
def self.create_default_options
  return {}
end

Public Instance Methods

run_and_get_exit_code() click to toggle source
# File src/ruby_supportlib/phusion_passenger/config/command.rb, line 33
def run_and_get_exit_code
  begin
    run
    exit(0)
  rescue SystemExit => e
    e.status
  end
end

Private Instance Methods

parse_options() click to toggle source
# File src/ruby_supportlib/phusion_passenger/config/command.rb, line 47
def parse_options
  @parser = self.class.create_option_parser(@options)
  begin
    @parser.parse!(@argv)
  rescue OptionParser::ParseError => e
    STDERR.puts "*** ERROR: #{e}"
    abort @parser.to_s
  end
  if @options[:help]
    puts @parser
    exit
  end
end