#!/usr/bin/env ruby require 'hitcher' require 'colorize' require_relative '../lib/hitcher/global' # # Hitcher run # global = Hitcher::Global.instance cs = File.join(Dir.getwd, global.config.spec_filename) if File.exist?(cs) cli = Hitcher::Cli.new inst = cli.parse(cs) if ARGV.length > 0 cmd = ARGV[0] case cmd when "run","r" cli.run(inst) when "run_prompt","rp" cli.run_prompt(inst) when "run_new_prompt", "rnp" cli.run_new_prompt(inst) when "-v" STDOUT.puts "Hitcher version #{Hitcher::VERSION}" else STDERR.puts "Unsupported command '#{cmd}'".red exit(-1) end else STDOUT.puts "Hitcher version #{Hitcher::VERSION}" STDOUT.puts "> Hitcher < run | r | run_prompt | rp | run_new_prompt | rnp >" exit(-1) end else STDERR.puts "cspec not found. Please provide one at #{Dir.getwd} or pass in as parameter" exit(-1) end