#!/usr/bin/env ruby require 'oct' require 'optparse' require 'term/ansicolor' require 'fileutils' available_actions = Oct::AVAILABLE_ACTIONS banner = < e puts "oct #{e}" puts "oct --help for more information" exit 1 end end # options from config file, if it exists, will not overwrite command line options = Oct::Settings.new(FileUtils.pwd, options).options if STDOUT.isatty || (options[:color] == 'ALWAYS') Term::ANSIColor::coloring = options[:color] if options[:color] && Oct::WINDOWS unless ENV['ANSICON'] begin require 'Win32/Console/ANSI' rescue LoadError Term::ANSIColor::coloring = false STDERR.puts 'WARNING: You must "gem install win32console" (1.2.0 or higher) or use the ANSICON driver (https://github.com/adoxa/ansicon) to get color output on MRI/Windows' end end end else Term::ANSIColor::coloring = false end app = Oct::App.new(FileUtils.pwd, ARGV.dup, options) app.execute