Sha256: 202eccc8775796949f72b3d726cef6b0bc53ba20886aeae512f8d8f38d642812

Contents?: true

Size: 949 Bytes

Versions: 1

Compression:

Stored size: 949 Bytes

Contents

module Heirloom
  module CLI
    class List

      def initialize
        @opts = read_options
        @logger = HeirloomLogger.new :log_level => @opts[:level]
        @archive = Archive.new :name   => @opts[:name],
                               :logger => @logger
      end
      
      def list(count = @opts[:count])
        puts @archive.list(count)
      end

      private

      def read_options
        Trollop::options do
          version Heirloom::VERSION
          banner <<-EOS

List versions of archive.

Usage:

heirloom list -n NAME

EOS
          opt :help, "Display Help"
          opt :level, "Log level.", :type    => :string,
                                    :default => 'info'
          opt :name, "Name of archive.", :type => :string
          opt :count, "Number of versions to return.", :type    => :integer,
                                                       :default => 10
        end
      end

    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
heirloom-0.2.0 lib/heirloom/cli/list.rb