Class: XRT::CLI

Inherits:
Object
  • Object
show all
Defined in:
lib/xrt/cli.rb

Instance Method Summary collapse

Instance Method Details

#execute(args) ⇒ Object



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

def execute(args)
  command_name = args.shift

  case command_name
  when 'dump'
    success = XRT::Command::Dump.new.execute(args)
    exit success ? 0 : 1
  when 'dump_blocks'
    XRT::Command::DumpBlocks.new.execute(args)
    exit 0
  when 'extract'
    success = XRT::Command::Extract.new.execute(*args)
    exit success ? 0 : 1
  when 'lcs'
    success = XRT::Command::LCS.new.execute(*args)
    exit success ? 0 : 1
  else
    warn "command not found"
    exit 1
  end
end