#!/usr/bin/env ruby require 'magellan/cli' begin Magellan::Cli::Command.start(ARGV) rescue Magellan::Cli::Error => e $stderr.puts("\e[31m#{e.message}\e[0m") exit(1) rescue => e verbose = ARGV.include?("-V") || ARGV.include?("--verbose") msg = "\e[31m[#{e.class}] #{e.message}\e[0m" msg << "\n " << e.backtrace.join("\n ") if verbose $stderr.puts(msg) exit(1) end