lib/heirloom/cli/list.rb in heirloom-0.3.1 vs lib/heirloom/cli/list.rb in heirloom-0.4.0

- old
+ new

@@ -1,20 +1,27 @@ module Heirloom module CLI class List + include Heirloom::CLI::Shared + def initialize @opts = read_options @logger = HeirloomLogger.new :log_level => @opts[:level] - exit 1 unless CLI::Shared.valid_options? :provided => @opts, - :required => [:name], - :logger => @logger + @config = load_config :logger => @logger, + :opts => @opts + + exit 1 unless valid_options? :provided => @opts, + :required => [:name], + :logger => @logger + @archive = Archive.new :name => @opts[:name], - :logger => @logger + :config => @config end def list(count = @opts[:count]) + @logger.debug "#{@archive.count} archives found." jj @archive.list(count) end private @@ -28,15 +35,17 @@ Usage: heirloom list -n NAME EOS + opt :count, "Number of versions to return.", :type => :integer, + :default => 10 opt :help, "Display Help" + opt :key, "AWS Access Key ID", :type => :string opt :level, "Log level [debug|info|warn|error].", :type => :string, :default => 'info' opt :name, "Name of archive.", :type => :string - opt :count, "Number of versions to return.", :type => :integer, - :default => 10 + opt :secret, "AWS Secret Access Key", :type => :string end end end end