module MiniTest

def self.plugin_rg_init options # :nodoc:

:nodoc:
def self.plugin_rg_init options # :nodoc:
  if RG.rg?
    io = RG.new options[:io]
    self.reporter.reporters.grep(Minitest::Reporter).each do |rep|
      rep.io = io if rep.io.tty?
    end
  end
end

def self.plugin_rg_options opts, options # :nodoc:

:nodoc:
def self.plugin_rg_options opts, options # :nodoc:
  opts.on "--rg", "Add red/green to test output." do
    RG.rg!
  end
end