Class: MultiCompress::DBDeployment::CLI

Inherits:
Object
  • Object
show all
Defined in:
lib/multi_compress/db_deployment.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.run(argv) ⇒ Object



24
25
26
# File 'lib/multi_compress/db_deployment.rb', line 24

def self.run(argv)
  new.run(argv)
end

Instance Method Details

#run(argv) ⇒ Object



28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
# File 'lib/multi_compress/db_deployment.rb', line 28

def run(argv)
  command = argv.shift

  case command
  when "package"
    PackageCommand.new.run(argv)
  when "view"
    ViewCommand.new.run(argv)
  when "registry"
    RegistryCommand.new.run(argv)
  when "help", "--help", "-h", nil
    puts help
    0
  else
    raise OptionParser::InvalidOption, "unknown db command: #{command.inspect}"
  end
rescue OptionParser::ParseError, Error => e
  warn "multi_compress db: #{e.message}"
  2
rescue SystemCallError, IOError => e
  warn "multi_compress db: #{e.message}"
  1
end