#!/usr/bin/env ruby $stdout.sync = true require 'optparse' require File.expand_path(File.dirname(__FILE__) + '/../lib/redimap') @logger = Redimap.logger # = Parse opts options = {} OptionParser.new do |opts| opts.banner = "Usage: redimap [options]" opts.on("-e", "--eternal", "Run eternally") do |e| options[:eternal] = true end end.parse! # = Main loop loop do Redimap.queue_new_mailboxes_uids break unless options[:eternal] @logger.debug { "Snoring for #{Redimap.config.polling_interval} s" } sleep Redimap.config.polling_interval # Sleep awhile. end