Class: Flux::CLI

Inherits:
Object
  • Object
show all
Defined in:
lib/superinstance/flux-runtime/cli.rb

Overview

Command-line interface for FLUX VM

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.run(args) ⇒ Object



11
12
13
# File 'lib/superinstance/flux-runtime/cli.rb', line 11

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

Instance Method Details

#run(args) ⇒ Object



15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# File 'lib/superinstance/flux-runtime/cli.rb', line 15

def run(args)
  command = args[0]
  path = args[1]

  case command
  when 'run'
    run_bytecode(path)
  when 'asm'
    assemble_file(path)
  when 'dis'
    disassemble_file(path)
  when 'repl'
    start_repl
  when 'help', nil
    print_help
  else
    $stderr.puts "Unknown command: #{command}"
    print_help
    exit 1
  end
end