class AcquiaToolbelt::CLI

Public Class Methods

start(given_args = ARGV, config = {}) click to toggle source
Calls superclass method
# File lib/acquia_toolbelt/cli.rb, line 24
def self.start(given_args = ARGV, config = {})
  if given_args.empty?
    abort 'No commands found. Run `acquia help` for a list of commands.'
  end

  Thor::Base.shell = AcquiaToolbelt::CLI::UI
  ui = AcquiaToolbelt::CLI::UI.new

  # Use a custom symbol to separate the commands. Useful for rake styled
  # commands.
  if given_args[0].include? ':'
    commands = given_args.shift.split(':')
    given_args = given_args.unshift(commands).flatten
  end

  super(given_args, { :shell => ui }.merge(config))
rescue AcquiaToolbelt::Error
  ui.print_exception(e)
  raise
rescue Interrupt => e
  puts
  ui.print_exception(e)
  ui.say 'Quitting...'
  raise
rescue SystemExit, Errno::EPIPE
  # Don't print a message for safe exits.
  raise
rescue Exception => e
  ui.print_exception(e)
  raise
end