bin/sup-add in sup-0.10.2 vs bin/sup-add in sup-0.11
- old
+ new
@@ -2,11 +2,11 @@
require 'uri'
require 'rubygems'
require 'highline/import'
require 'trollop'
-require "sup"; Redwood::check_library_version_against "0.10.2"
+require "sup"; Redwood::check_library_version_against "0.11"
$opts = Trollop::options do
version "sup-add (sup #{Redwood::VERSION})"
banner <<EOS
Adds a source to the Sup source list.
@@ -18,19 +18,10 @@
For mbox files on local disk, use the form:
mbox:<path to mbox file>, or
mbox://<path to mbox file>
-For mbox files on remote machines, use the form:
- mbox+ssh://<machine name>/<path to mbox file>
-
-For IMAP folders, use the form (note no username or password!):
- imap://<machine name>/ # unsecure, "INBOX" folder
- imap://<machine name>/<folder> # unsecure, arbitrary
- imaps://<machine name>/ # secure, "INBOX" folder
- 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:
@@ -38,11 +29,10 @@
opt :archive, "Automatically archive all new messages from these sources."
opt :unusual, "Do not automatically poll these sources for new messages."
opt :labels, "A comma-separated set of labels to apply to all messages from this source", :type => String
opt :force_new, "Create a new account for this source, even if one already exists."
opt :force_account, "Reuse previously defined account user@hostname.", :type => String
- opt :index, "Use this index type ('auto' for autodetect)", :default => "auto"
end
Trollop::die "require one or more sources" if ARGV.empty?
## for sources that require login information, prompt the user for
@@ -84,11 +74,11 @@
[username, password]
end
$terminal.wrap_at = :auto
Redwood::start
-index = Redwood::Index.init $opts[:index]
+index = Redwood::Index.init
index.load
index.lock_interactively or exit
begin
@@ -104,17 +94,9 @@
parsed_uri = URI(uri)
source =
case parsed_uri.scheme
- when "mbox+ssh"
- say "For SSH connections, if you will use public key authentication, you may leave the username and password blank."
- say ""
- username, password = get_login_info uri, Redwood::SourceManager.sources
- Redwood::MBox::SSHLoader.new uri, username, password, nil, !$opts[:unusual], $opts[:archive], nil, labels
- when "imap", "imaps"
- username, password = get_login_info uri, Redwood::SourceManager.sources
- Redwood::IMAP.new uri, username, password, nil, !$opts[:unusual], $opts[:archive], nil, labels
when "maildir"
Redwood::Maildir.new uri, nil, !$opts[:unusual], $opts[:archive], nil, labels
when "mbox"
Redwood::MBox::Loader.new uri, nil, !$opts[:unusual], $opts[:archive], nil, labels
when nil