--force-read: any messages found will not be marked as new.
The following options can also be specified:
+ --verbose: print message ids as they're processed
--the-usual: import new messages from all usual sources
--rebuild: rebuild the index for the specified sources rather than
just adding new messages. Useful if the sources
EOS
exit
end
+#' stupid ruby-mode
## for sources that require login information, prompt the user for
## that. also provide a list of previously-defined login info to
rebuild = ARGV.delete "--rebuild"
force_rebuild = ARGV.delete "--force-rebuild"
optimize = ARGV.delete "--optimize"
+verbose = ARGV.delete "--verbose"
start_at = # ok really need to use optparse or something now
if(i = ARGV.index("--start-at"))
raise "start-at requires a numeric argument: #{ARGV[i + 1].inspect}" unless ARGV.length > (i + 1) && ARGV[i + 1] =~ /\d/
end
m.remove_label :unread if m.source_marked_read? unless force_read
- puts "# message at #{offset}, labels: #{labels * ', '}" unless rebuild
+ puts "# message at #{offset}, labels: #{labels * ', '}" if verbose unless rebuild
if (rebuild || force_rebuild) &&
(docid, entry = index.load_entry_for_id(m.id)) && entry
if force_rebuild || entry[:source_info].to_i != offset
@mutex.synchronize { connect or raise SourceError, broken_msg }
@ids.last
end
+
+ def pct_done; 100.0 * (@ids.index(cur_offset) || 0).to_f / (@ids.length - 1).to_f; end
end
Redwood::register_yaml(IMAP, %w(uri username password cur_offset usual archived id))