class Berkshelf::Cli::Runner

def execute!

def execute!
  $stdin  = @stdin
  $stdout = @stdout
  $stderr = @stderr
  Berkshelf::Cli.start(@argv)
  @kernel.exit(0)
rescue Berkshelf::BerkshelfError => e
  Berkshelf.ui.error e
  Berkshelf.ui.error "\t" + e.backtrace.join("\n\t") if ENV["BERKSHELF_DEBUG"]
  @kernel.exit(e.status_code)
rescue => e
  Berkshelf.ui.error "#{e.class} #{e}"
  Berkshelf.ui.error "\t" + e.backtrace.join("\n\t") if ENV["BERKSHELF_DEBUG"]
  @kernel.exit(47)
end