Sha256: 7262b0ca17ef41d644faf3ccf8df30fc429a55bea2f2c6bd60ebe67228ab061e

Contents?: true

Size: 1003 Bytes

Versions: 1

Compression:

Stored size: 1003 Bytes

Contents

require 'trollop'

require 'heirloom/cli/shared'
require 'heirloom/cli/authorize'
require 'heirloom/cli/build'
require 'heirloom/cli/list'
require 'heirloom/cli/show'
require 'heirloom/cli/update'
require 'heirloom/cli/download'
require 'heirloom/cli/destroy'

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

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

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
heirloom-0.4.0 lib/heirloom/cli.rb