#!/usr/bin/env ruby # # WLang: Code generation/Templating engine tool # (see lib/wlang/wlang.rb for more information) # # Copyright (c) 2009 University of Louvain, Bernard & Louis Lambeau # Released under a MIT or Ruby licence # $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib')) require 'wlang' require 'wlang/wlang_command' begin r = WLang::WLangCommand.new r.run ARGV rescue ::WLang::Error => e $stderr.puts e.message $stderr.puts e.wlang_backtrace.join("\n\t") $stderr.puts e.backtrace.join("\n\t") rescue Interrupt => e $stderr.puts $stderr.puts "Interrupted" raise e rescue OptionParser::ParseError => e $stderr.puts e.message raise e rescue => e $stderr.puts e.message raise e end