#!/usr/bin/env ruby require 'pathname' $:.unshift Pathname.new(__FILE__).realpath.join('../../lib') if $0 == __FILE__ require 'earthquake/option_parser' require "earthquake/version" option_parser = Earthquake::OptionParser.new(ARGV.dup) options = nil begin options = option_parser.parse rescue Earthquake::OptionParser::Help exit rescue => e puts e exit! end command = options.delete(:command) no_logo = options.delete(:'no-logo') if !no_logo && !command print "\e[31m" puts %q{ _ _ _ ___ __ _ _ __| |_| |__ __ _ _ _ __ _| | _____ / _ \/ _` | '__| __| '_ \ / _` | | | |/ _` | |/ / _ \ | __/ (_| | | | |_| | | | (_| | |_| | (_| | < __/ \___|\__,_|_| \__|_| |_|\__, |\__,_|\__,_|_|\_\___| |_| }. gsub(/^\n/, '') + "v#{Earthquake::VERSION}".rjust(10) + "\n\n" print "\e[0m" end require 'earthquake' if command result = Earthquake.invoke(command, options) result.join if result.is_a?(Thread) else Earthquake.start(options) end