Sha256: 33ca6460ac628bd7a5231e0a27afb83dac6cd1ad816a89ecf4c9f3c9bcb4188d

Contents?: true

Size: 1004 Bytes

Versions: 3

Compression:

Stored size: 1004 Bytes

Contents

require 'trollop'

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'

require 'heirloom/cli/shared'

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

3 entries across 3 versions & 1 rubygems

Version Path
heirloom-0.3.1 lib/heirloom/cli.rb
heirloom-0.3.0 lib/heirloom/cli.rb
heirloom-0.3.0.rc1 lib/heirloom/cli.rb