Class: DMG::CLI

Inherits:
Object
  • Object
show all
Extended by:
OutputHelpers
Defined in:
lib/dmg/cli.rb

Class Method Summary collapse

Methods included from OutputHelpers

alert, debug, info

Class Method Details

.run!Object



5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# File 'lib/dmg/cli.rb', line 5

def run!

  DMG.setup!

  case ARGV[0]
  when "install"
    DMG::Pkg.install(ARGV[1..-1])
  when "list"
    puts DMG::Pkg.list
  else
    puts <<-EOF
  Usage: 
dmg install PACKAGE
dmg list
  EOF
  end

rescue DMG::DMGError => e
  alert(e.message)
end