#!/bin/sh
# the next line is not read by tcl \
TCLBINARY=tclsh; source `dirname $0`/configuration
# the next line restarts using tclsh \
exec $TCLBINARY "$0" "$@"

if { ![file readable [lindex $argv 0]] } {
    puts "Can't read file \"[lindex $argv 0]\""
    exit 1
}

set nameOfThisScript [file normalize $argv0]
set homeOfThisScript [file dirname $nameOfThisScript]
source [file join $homeOfThisScript opetopes.tcl]

if { [llength $argv] < 1 || [lindex $argv 1] ne "-o"} {
    puts "Wrong number of arguments.  Usage: \"[file tail $argv0] XMLFILE ?-o OUTPUTPATH?\""
    exit 1
}

puts [eval computeTarget $argv]


