view tpc @ 338:1458c069c715

Added "value" method to option value and option none. It behaves similarly to value:none, except the none case just propagates the none value and the value case wraps the result in an option value
author Michael Pavone <pavone@retrodev.com>
date Sat, 04 Apr 2015 11:54:46 -0700
parents c801dccdb4fb
children
line wrap: on
line source

#!/bin/sh

args=
dir=`dirname $0`
while [ $# -gt 0 ]; do
	if [ "-o" = "$1" ]; then
		shift
		output="$1"
	else	
		args="$args $1"
	fi
	shift
done

if [ $output ]; then
	if d8 $dir/tpc.js -- $args > $output; then
		exit
	else
		code=$?
		cat $output 1>&2
		rm -f $output
		exit $code
	fi
else
	d8 $dir/tpc.js -- $args
fi