Class: EY::Tools::CLI::Base

Inherits:
EY::Thor
  • Object
show all
Includes:
Thor::Actions
Defined in:
lib/ey_tools/base.rb

Direct Known Subclasses

EY::Tools::Console::CLI

Class Method Summary collapse

Class Method Details

.start(given_args = ARGV, config = {}) ⇒ Object



21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# File 'lib/ey_tools/base.rb', line 21

def self.start(given_args=ARGV, config={})
  Thor::Base.shell = EY::CLI::UI
  ui = EY::CLI::UI.new
  super(given_args, {:shell => ui}.merge(config))
rescue EY::Error, EY::CloudClient::Error => e
  ui.print_exception(e)
  exit 1
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