module NewRelicManagement::CLI

> NewRelic Launcher

Public Instance Methods

configure(argv = ARGV) click to toggle source

> Configure the CLI

# File lib/newrelic-management/cli.rb, line 67
def configure(argv = ARGV)
  # => Parse CLI Configuration
  cli = Options.new
  cli.parse_options(argv)

  # => Parse JSON Config File (If Specified and Exists)
  json_config = Util.parse_json(cli.config[:config_file] || Config.config_file)

  # => Merge Configuration (CLI Wins)
  config = [json_config, cli.config].compact.reduce(:merge)

  # => Apply Configuration
  config.each { |k, v| Config.send("#{k}=", v) }
end
run(argv = ARGV) click to toggle source

> Launch the Application

# File lib/newrelic-management/cli.rb, line 83
def run(argv = ARGV)
  # => Parse the Params
  configure(argv)

  # => Launch the Controller
  Controller.run
end