#!/usr/bin/env ruby
# frozen_string_literal: true

$LOAD_PATH.unshift(File.expand_path('../lib', __dir__))
require 'rggen/core'

begin
  cli = RgGen::Core::CLI.new
  cli.run(ARGV)
rescue ScriptError, StandardError => e
  options = [cli.options[:print_verbose_info], cli.options[:print_backtrace]]
  abort RgGen::Core::Utility::ErrorUtility.compose_error_message(e, *options)
end
