Sha256: 89c2a3fd827a1b9a40b932fc4e8caf6bbfcc24dccb39d0527b4a0e7e1a3efdf4

Contents?: true

Size: 1.08 KB

Versions: 2

Compression:

Stored size: 1.08 KB

Contents

require 'json'
require 'trollop'

require 'heirloom/cli/shared'
require 'heirloom/cli/authorize'
require 'heirloom/cli/upload'
require 'heirloom/cli/setup'
require 'heirloom/cli/list'
require 'heirloom/cli/show'
require 'heirloom/cli/tag'
require 'heirloom/cli/download'
require 'heirloom/cli/destroy'

module Heirloom
  module CLI
    def self.start
      cmd = ARGV.shift

      case cmd
      when 'authorize'
        CLI::Authorize.new.authorize
      when 'destroy', 'delete'
        CLI::Destroy.new.destroy
      when 'download'
        CLI::Download.new.download
      when 'list'
        CLI::List.new.list
      when 'setup'
        CLI::Setup.new.setup
      when 'show'
        CLI::Show.new.show
      when 'update', 'tag'
        CLI::Tag.new.tag
      when 'build', 'upload'
        CLI::Upload.new.upload
      when '-v'
        puts Heirloom::VERSION
      else
        puts "Unkown command: '#{cmd}'." unless cmd == '-h'
        puts "heirloom [authorize|destroy|download|list|setup|show|tag|upload] OPTIONS"
        puts "Append -h for help on specific command."
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
heirloom-0.6.1 lib/heirloom/cli.rb
heirloom-0.6.0rc1 lib/heirloom/cli.rb