summaryrefslogtreecommitdiff
path: root/bin/feed2imap
blob: 06a68539bebdf8b656fa465f1be078d696652ca4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#!/usr/bin/ruby

$:.unshift File.join(File.dirname(__FILE__), '..', 'lib')

require 'feed2imap/feed2imap'
require 'optparse'

verbose = false
version = false
cacherebuild = false
configf = ENV['HOME'] + '/.feed2imaprc'
opts = OptionParser::new do |opts|
  opts.banner = "Usage: ./feed2imap.rb [options]"
  opts.separator ""
  opts.separator "Options:"
  opts.on("-v", "--verbose", "Verbose mode") do |v|
    verbose = true
  end
  opts.on("-V", "--version", "Display Feed2Imap version") do |v|
    version = true
  end
  opts.on("-c", "--rebuild-cache", "Cache rebuilding run : will fetch everything and cache, as if it was already read.") do |c|
    cacherebuild = true
  end
  opts.on("-f", "--config <file>", "Select alternate config file") do |f|
    configf = f
  end
end
opts.parse!(ARGV)

if version
  puts "Feed2Imap v.#{F2I_VERSION}"
else
  Feed2Imap::new(verbose, cacherebuild, configf)
end