#!/usr/bin/env ruby require 'dfect' if ARGV.delete('-h') or ARGV.delete('--help') # try to display UNIX version of help manual man_path = File.join(Dfect::INSTDIR, 'man') unless system 'man', '-M', man_path, '-a', 'dfect' # try to display HTML version of help manual man_html = man_path + '.html' unless %w[$BROWSER open start].any? {|b| system "#{b} #{man_html}" } # no luck; direct user to project website puts "See #{Dfect::WEBSITE}" end end exit elsif ARGV.delete('-v') or ARGV.delete('--version') puts Dfect::VERSION exit end Dfect.options[:debug] = ARGV.delete('-d') || ARGV.delete('--debug') Dfect.options[:quiet] = ARGV.delete('-q') || ARGV.delete('--quiet') require 'dfect/auto' ARGV.each {|glob| Dir[glob].each {|test| load test } }