end
if $0 == __FILE__
+ require 'optparse'
+
+ opts = ARGV.getopts('l:', 'limit:', 'skip:')
+ limit_pat = opts['limit'] || opts['l']
+ limit_pat and
+ limit_pat = Regexp.new(limit_pat)
+
list = YAML.load_file(ARGV[0] || 'image-list.yml')
list.each do |imgdef|
name = nil
else
name = imgdef
end
+ if limit_pat
+ limit_pat.match?(name) or next
+ end
dirs.empty? and dirs << SyncDirDef.new
ImageCreator.new(name, dirs).run
end