Class: Hackasm::CLI

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

Overview

Handle the application command line parsing and the dispatch to various command objects

Constant Summary collapse

Error =

Error raised by this runner

Class.new(StandardError)

Instance Method Summary collapse

Instance Method Details

#asm2binary(file) ⇒ Object



36
37
38
39
40
41
42
43
# File 'lib/hackasm/cli.rb', line 36

def asm2binary(file)
  if options[:help]
    invoke :help, ['asm2binary']
  else
    require_relative 'commands/asm2binary'
    Hackasm::Commands::Asm2Binary.new(file, options).execute
  end
end

#versionObject



15
16
17
18
# File 'lib/hackasm/cli.rb', line 15

def version
  require_relative 'version'
  puts "v#{Hackasm::VERSION}"
end

#vm2asm(base_path) ⇒ Object



24
25
26
27
28
29
30
31
# File 'lib/hackasm/cli.rb', line 24

def vm2asm(base_path)
  if options[:help]
    invoke :help, ['vm2asm']
  else
    require_relative 'commands/vm2asm'
    Hackasm::Commands::Vm2Asm.new(base_path, options).execute
  end
end