var fs = require("fs");
var program = require("commander");

var lib = require("./lib");

var packageJson = JSON.parse(fs.readFileSync(__dirname + "/../package.json").toString());

program.version(packageJson.version).usage("[options] <file ...>").option("-r, --replace", "Replace .ts file").parse(process.argv);

var replace = !!program.replace;
var args = program.args;
if (args.length === 0) {
    program.outputHelp();
    process.exit(1);
}

lib.processFiles({ replace: replace }, args);
