#!/usr/bin/ruby.ruby3.4 
# frozen_string_literal: true

# executes one of the commands in the new_relic/commands directory
# pass the name of the command as an argument

$LOAD_PATH << File.expand_path(File.join(File.dirname(__FILE__), '..', 'lib'))
require 'new_relic/cli/command'
begin
  NewRelic::Cli::Command.run
rescue NewRelic::Cli::Command::CommandFailure => failure
  STDERR.puts failure.message
  STDERR.puts failure.options if failure.options
  exit(1)
end
