#!/usr/bin/env ruby # Wrapper around the real `as` which adds filtering capabilities. require "tempfile" require "fileutils" def wrapped_as(argv) args=[] input=nil i = 0 while i input, 1 => tempfile.path) status=$?.exitstatus FileUtils.rm tempfile exit status end args.push(tempfile.path) # Call the real assembler: res = system("as", *args) status = if res != nil $?.exitstatus else 1 end FileUtils.rm tempfile exit status end wrapped_as(ARGV)