summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorlnu <lnu@f70e237a-67f3-0310-a06c-d2b8a7116972>2006-10-23 16:21:20 +0000
committerlnu <lnu@f70e237a-67f3-0310-a06c-d2b8a7116972>2006-10-23 16:21:20 +0000
commitdd108ab5ffc959ebfaf326769e5fc74822b6647b (patch)
treeb384cddf85540a0285c792fcef66016f6e858b34 /bin
parent5eb10f0ee87a84103dd605efa16783dfeec53a54 (diff)
downloadfeed2imap-dd108ab5ffc959ebfaf326769e5fc74822b6647b.tar.gz
feed2imap-dd108ab5ffc959ebfaf326769e5fc74822b6647b.tar.bz2
feed2imap-dd108ab5ffc959ebfaf326769e5fc74822b6647b.zip
git-svn-id: svn+ssh://svn.gna.org/svn/feed2imap/trunk/feed2imap@105 f70e237a-67f3-0310-a06c-d2b8a7116972
Diffstat (limited to '')
-rwxr-xr-xbin/feed2imap17
1 files changed, 15 insertions, 2 deletions
diff --git a/bin/feed2imap b/bin/feed2imap
index 0095d9f..b31c191 100755
--- a/bin/feed2imap
+++ b/bin/feed2imap
@@ -9,13 +9,20 @@ verbose = false
version = false
cacherebuild = false
configf = ENV['HOME'] + '/.feed2imaprc'
+progname = File::basename($PROGRAM_NAME)
opts = OptionParser::new do |opts|
- opts.banner = "Usage: ./feed2imap.rb [options]"
+ opts.banner = "Usage: #{progname} [options]"
opts.separator ""
opts.separator "Options:"
+
opts.on("-v", "--verbose", "Verbose mode") do |v|
verbose = true
end
+
+ opts.on("-d", "--debug", "Debug mode") do |v|
+ verbose = :debug
+ end
+
opts.on("-V", "--version", "Display Feed2Imap version") do |v|
version = true
end
@@ -26,7 +33,13 @@ opts = OptionParser::new do |opts|
configf = f
end
end
-opts.parse!(ARGV)
+begin
+ opts.parse!(ARGV)
+rescue OptionParser::ParseError => pe
+ opts.warn pe
+ puts opts
+ exit 1
+end
if version
puts "Feed2Imap v.#{F2I_VERSION}"