Method: Skytap#exec!
- Defined in:
- lib/skytap.rb
#exec! ⇒ Object
Returns a numeric code indicating exit status; 0 iff success.
47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 |
# File 'lib/skytap.rb', line 47 def exec! #TODO:NLA Rename to something indicating that this is called when running from a command-line context. response = begin args, , = CommandLine.parse(ARGV) logger = Logger.new([:'log-level']) # Disable color if needed. We don't unconditionally execute this line so that # color is still disabled for non-TTY terminals irrespective of the colorize # setting. Sickill::Rainbow.enabled = false unless [:colorize] build_response(Commands::Root.go!(logger, args, , )) rescue SystemExit raise rescue Interrupt return 0 rescue Exception => ex log_exception(ex, args, , ) build_response(ex) end if response.error? if logger logger.info response. else $stderr.puts response. end return 1 else return 0 end end |