Sha256: 093fe329231cf018c543f9c56445ca6e690e9c15bec620f4aa4fd1551fc5eb9b

Contents?: true

Size: 734 Bytes

Versions: 8

Compression:

Stored size: 734 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|
          Kernel.puts connection.account.username
          # TODO: Make folder_names private once this command
          # has been removed.
          folders = connection.folder_names
          if folders.nil?
            Kernel.warn "Unable to list account folders"
            return false
          end
          folders.each { |f| Kernel.puts "\t#{f}" }
        end
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
imap-backup-7.0.2 lib/imap/backup/cli/folders.rb
imap-backup-7.0.0.rc1 lib/imap/backup/cli/folders.rb
imap-backup-6.3.0 lib/imap/backup/cli/folders.rb
imap-backup-6.2.1 lib/imap/backup/cli/folders.rb
imap-backup-6.1.0 lib/imap/backup/cli/folders.rb
imap-backup-6.0.1 lib/imap/backup/cli/folders.rb
imap-backup-6.0.0 lib/imap/backup/cli/folders.rb
imap-backup-6.0.0.rc2 lib/imap/backup/cli/folders.rb