52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
|
# File 'lib/imapget/cli.rb', line 52
def run(arguments)
profiles, default_config = config.partition { |k,| k.is_a?(String) }
(arguments.empty? ? profiles.map(&:first) : arguments).each { |profile|
profile_config = profile_config(profile, profiles, default_config) or next
imapget = IMAPGet.new(profile_config)
if options[:check]
imapget.each { |mailbox| puts mailbox.name }
elsif options[:dupes]
imapget.each { |mailbox| imapget.dupes(mailbox.name) }
elsif options[:uniq]
imapget.each { |mailbox| imapget.uniq!(mailbox.name) {
next unless agree('Really delete duplicates? ')
} }
else
imapget.get(options[:directory] ||
File.join(profile_config[:base_dir] || '.', profile))
end
}
end
|