Sha256: b6df67480a5e7280b99ef07c10a57f0186af3800f44c0d0d9fb2604a00e973eb

Contents?: true

Size: 1005 Bytes

Versions: 4

Compression:

Stored size: 1005 Bytes

Contents

#! /usr/bin/env ruby

require_relative '../lib/haxor'
require 'optparse'

options = {}
parser = OptionParser.new do |opts|
  opts.banner = 'Usage: hld [options] [file.hax.u] [...]'

  opts.on('-o', '--output FILENAME', 'Write output to FILENAME') do |v|
    options[:output] = v
  end

  opts.on('-s', '--stack SIZE', OptionParser::DecimalInteger, 'Stack size in bytes') do |v|
    options[:stack] = v
  end

  opts.on_tail('-h', '--help', 'Show this message') do
    puts opts
    exit
  end

  opts.on_tail('-v', '--version', 'Show version') do
    puts "Haxor, version #{Haxor::Consts::GEM_VERSION}, version id #{Haxor::Consts::VERSION}."
    exit
  end
end

parser.parse!

unless options.key?(:output) && !ARGV.empty?
  puts 'You must specify output filename and at least one .hax.u file to be linked.'
  puts parser
  exit
end

linker = Haxor::Linker.new
ARGV.map do |x|
  linker.load_unit File.absolute_path(x)
end

linker.stack = options[:stack] if options.key? :stack
linker.link options[:output]

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
haxor-0.5.0 bin/hld
haxor-0.4.0 bin/hld
haxor-0.3.0 bin/hld
haxor-0.2.0 bin/hld