Sha256: 108ed6c31f736eaac5607931b6331be94bc902fa2ddea5f17127b21ea2035d1f

Contents?: true

Size: 713 Bytes

Versions: 5

Compression:

Stored size: 713 Bytes

Contents

module Imap::Backup
  class CLI::Folders < Thor
    include Thor::Actions
    include CLI::Helpers

    attr_reader :account_names

    def initialize(options)
      super([])
      @account_names = (options[:accounts] || "").split(",")
    end

    no_commands do
      def run
        each_connection(account_names) do |connection|
          puts connection.account.username
          # TODO: Make folder_names private once this command
          # has been removed.
          folders = connection.folder_names
          if folders.nil?
            warn "Unable to list account folders"
            return false
          end
          folders.each { |f| puts "\t#{f}" }
        end
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
imap-backup-5.2.0 lib/imap/backup/cli/folders.rb
imap-backup-5.1.0 lib/imap/backup/cli/folders.rb
imap-backup-5.0.0 lib/imap/backup/cli/folders.rb
imap-backup-4.2.2 lib/imap/backup/cli/folders.rb
imap-backup-4.2.1 lib/imap/backup/cli/folders.rb