#!/usr/bin/env node // Generated by CoffeeScript 2.3.0 (function() { //!/usr/bin/env coffee var argv, compiler, input_file, input_text; module.paths.unshift(`${require('path').dirname(__dirname)}/lib`); require('testml-compiler/prelude'); require('testml-compiler/compiler'); argv = process.argv.slice(2); if (argv.length !== 1) { die("testml-compiler | - | --version"); } if (argv[0] === '--version') { say(`TestML version '${TestMLCompiler.VERSION}'`); exit(0); } else if (argv[0].match(/^-./)) { die(`Unknown argument '${argv[0]}'`); } input_file = argv[0]; if (input_file == null) { throw "usage: testml-compiler "; } if (!(input_file === '-' || file_exists(input_file))) { throw `Input file does not exist: '${input_file}'`; } input_text = read_file(input_file); compiler = new TestMLCompiler.Compiler; out(compiler.compile(input_text, input_file)); // vim: sw=2 lisp: }).call(this);