Sha256: f3ace3d22297a4be43d5d6776e82675f5a0f0673689b9896021d1b6dfc47838d
Contents?: true
Size: 1.42 KB
Versions: 10
Compression:
Stored size: 1.42 KB
Contents
#!/usr/bin/env ruby require 'dcgen' require 'optparse' require 'pp' options = {} parser = OptionParser.new do |opts| opts.banner = 'Usage: dcgen [options]' opts.on('-m', '--master dir', 'Source dir') do |dir| options[:master] = dir end opts.on('-d', '--destination dir', 'Destination dir') do |dir| options[:destination] = dir end opts.on('-o', '--output FILE', 'Output file to write instead of destructiveChange.xml') do |file| options[:output] = file end opts.on('-x', '--exclude CSV_METADATA_LIST', 'a CSV list of metadata to exclude') do |exclude| options[:exclude] = exclude.split(',') end opts.on('-v', '--version', 'Show current version') do puts Dcgen::VERSION exit 0 end opts.on('-h', '--help', 'Displays Help') do puts opts exit end if ARGV.empty? puts opts exit 1 end end begin parser.parse! rescue => e puts "error: #{e}" exit 1 end if options[:master].nil? puts "error: you must specify master dir" exit 1 end if options[:destination].nil? puts "error: you must specify destination dir" exit 1 end begin dcgen = Dcgen::App.new dcgen.master = options[:master] dcgen.destination = options[:destination] dcgen.output = options[:output] if not options[:output].nil? dcgen.exclude = options[:exclude] if not options[:exclude].nil? dcgen.generate_destructive_changes rescue ArgumentError => e puts "error: #{e}" exit 1 end
Version data entries
10 entries across 10 versions & 1 rubygems