]> git.cworth.org Git - sup/commitdiff
improved help text and now all args must be uris (no more mbox defaulting)
authorwmorgan <wmorgan@5c8cc53c-5e98-4d25-b20a-d8db53a31250>
Mon, 2 Apr 2007 05:12:40 +0000 (05:12 +0000)
committerwmorgan <wmorgan@5c8cc53c-5e98-4d25-b20a-d8db53a31250>
Mon, 2 Apr 2007 05:12:40 +0000 (05:12 +0000)
git-svn-id: svn://rubyforge.org/var/svn/sup/trunk@367 5c8cc53c-5e98-4d25-b20a-d8db53a31250

bin/sup-add
bin/sup-sync

index caff68d45f05b6e9b27a7dca726758e4155aa503..48949207ad48bdd4230e79d090213641715efeb0 100644 (file)
@@ -12,14 +12,13 @@ $opts = Trollop::options do
 Adds a source to the Sup source list.
 
 Usage:
-  sup-add [options] <source>+
+  sup-add [options] <source uri>+
 
-where <source>+ is one or more sources.
+where <source uri>+ is one or more source URIs.
 
 For mbox files on local disk, use the form:
+    mbox:<path to mbox file>, or
     mbox://<path to mbox file>
-or simply
-    <path to mbox file>
 
 For mbox files on remote machines, use the form:
     mbox+ssh://<machine name>/<path to mbox file>
@@ -31,6 +30,7 @@ For IMAP folders, use the form (note no username or password!):
     imaps://<machine name>/<folder> # secure, arbitrary folder 
 
 For Maildir folders, use the form:
+    maildir:<path to Maildir directory>; or
     maildir://<path to Maildir directory>
 
 Options are:
@@ -80,8 +80,6 @@ index = Redwood::Index.new
 index.load
 
 ARGV.each do |uri|
-  uri = "mbox://#{uri}" unless uri =~ %r!://!
-
   if !$opts[:force_new] && index.source_for(uri) 
     say "Already know about #{uri}; skipping."
     next
index f71f6b002f1392679d82e0bfcdff221a732555f1..9adecc028de5938c22e373a852e57ca8b12950ed 100644 (file)
@@ -43,14 +43,8 @@ Usage:
   sup-sync [options] <source>*
 
 where <source>* is zero or more source URIs. If no sources are given,
-sync from all usual sources.
-
-Supported source URIs:
-  mbox://<path to mbox file>,      e.g. mbox:///var/spool/mail/me
-  maildir://<path to maildir dir>, e.g. maildir:///home/me/Maildir
-  mbox+ssh://<machine>/<path to mbox file>
-  imap://<machine>/[<folder>]
-  imaps://<machine>/[<folder>]
+sync from all usual sources. All supported source URI schemes can
+be seen by running "sup-add --help".
 
 Options controlling WHICH messages sup-sync operates on:
 EOS
@@ -199,6 +193,9 @@ begin
     $stderr.puts "Scanned #{num_scanned}, added #{num_added}, updated #{num_updated} messages from #{source}."
     $stderr.puts "Restored state on #{num_restored} (#{100.0 * num_restored / num_scanned}%) messages." if num_restored > 0
   end
+rescue Exception => e
+  File.open("sup-exception-log.txt", "w") { |f| f.puts e.backtrace }
+  raise
 ensure
   index.save
   Redwood::finish