Class: S3Sync::CLI::ListBuckets

Inherits:
BaseCmd
  • Object
show all
Defined in:
lib/s3sync/cli.rb

Instance Method Summary collapse

Methods inherited from BaseCmd

#execute, #has_options?, #has_prefix?, #usage

Constructor Details

#initializeListBuckets

Returns a new instance of ListBuckets.



103
104
105
106
107
# File 'lib/s3sync/cli.rb', line 103

def initialize
  super 'listbuckets', takes_commands: false #, false, false

  @short_desc = "List all available buckets for your user"
end

Instance Method Details

#run(s3, bucket, key, file, args) ⇒ Object



109
110
111
112
113
# File 'lib/s3sync/cli.rb', line 109

def run s3, bucket, key, file, args
  s3.buckets.each do |bkt|
    puts "#{bkt.name}"
  end
end