#!/usr/bin/env ruby require "rubygems" require File.dirname(__FILE__) + "/../lib/csvget" require "rwget" parser = RWGetOptionParser.new do |opts| opts.on("--parselet=JSON_FILE", "JSON_FILE is a parselet.") do |path| parser.options[:parselets] ||= [] parser.options[:parselets] << path end opts.on("--filter=RUBY_CODE", "RUBY_CODE will be eval'd in context of @row.is_a?(FasterCSV::Row)") do |filter| parser.options[:filter] ||= [] parser.options[:filter] << filter end end parser.parse! if parser.options[:seeds].empty? puts parser.usage puts " -h for options listing" exit(1) end parser.options[:store_class] ||= "CSVStore" controller = RWGet::Controller.new(parser.options) begin controller.start ensure STDERR.puts "Closing..." controller.close end