-where <source>* is zero or more source descriptions (e.g., mbox
-filenames on disk, or imap/imaps URIs).
-
-If the sources listed are not already in the Sup source list,
-they will be added to it, as parameterized by the following options:
- --archive: messages from these sources will not appear in the inbox
- --unusual: these sources will not be polled when the flag --the-usual
- is called
-
-Regardless of whether the sources are new or not, they will be polled,
-and any new messages will be added to the index, as parameterized by
-the following options:
- --force-archive: regardless of the source "archive" flag, any new
- messages found will not appear in the inbox.
- --force-read: any messages found will not be marked as new.
-
-The following options can also be specified:
- --verbose: print message ids as they're processed
- --the-usual: import new messages from all usual sources
- --rebuild: rebuild the index for the specified sources rather than
- just adding new messages. Useful if the sources
- have changed in any way *other* than new messages
- being added.
- --force-rebuild: force a rebuild of all messages in the inbox, not just
- ones that have changed. You probably won't need this
- unless William changes the index format.
- --optimize: optimize the index after adding any new messages.
- --help: don't do anything, just show this message.
-EOS
- exit
-end
-#' stupid ruby-mode
-
-## for sources that require login information, prompt the user for
-## that. also provide a list of previously-defined login info to
-## choose from, if any.
-def get_login_info uri, sources
- uri = URI(uri)
- accounts = sources.map do |s|
- next unless s.respond_to?(:username)
- suri = URI(s.uri)
- [suri.host, s.username, s.password]
- end.compact.uniq.sort_by { |h, u, p| h == uri.host ? 0 : 1 }
-
- username, password = nil, nil
- unless accounts.empty?
- say "Would you like to use the same account as for a previous source for #{uri}?"
- choose do |menu|
- accounts.each do |host, olduser, oldpw|
- menu.choice("Use the account info for #{olduser}@#{host}") { username, password = olduser, oldpw }
- end
- menu.choice("Use a new account") { }
- menu.prompt = "Account selection? "
- end
- end