#! /usr/bin/ruby1.8 if ARGV[0] == '-s' require 'ratch/manager' manager = Ratch::Manager.new file = ARGV[1] if file # run tool if tool = manager.tool?(file) require 'ratch/batch' load(tool) else puts "no tool -- #{file}" end else puts manager.toolset.join("\n") end elsif ARGV.empty? # TODO read stdin for ratch script else require 'ratch/batch' load($0 = ARGV.shift) end # module Ratch # # class RatchCommand # # # Quick start. # # def self.start(file) # new.run(file) # end # # # Run task. # # def run(file) # if file # BatchFile.new(file).call # else # help # end # end # # # Dispaly help. # # def help # help = <<-END # USAGE: # # ratch [options] # # OPTIONS: # # --dryrun --nohram # # --trace # # --debug # END # puts help.gsub(/^\s+/, '') # end # # end # # end