1 | "use strict";
|
2 | var __importDefault = (this && this.__importDefault) || function (mod) {
|
3 | return (mod && mod.__esModule) ? mod : { "default": mod };
|
4 | };
|
5 | Object.defineProperty(exports, "__esModule", { value: true });
|
6 | const commander_1 = __importDefault(require("commander"));
|
7 | const _1 = require(".");
|
8 | async function exec(argv) {
|
9 | commander_1.default
|
10 | .name('fts')
|
11 | .usage('[options] <file.ts>')
|
12 | .option('-p, --project <project>', "Path to 'tsconfig.json'.")
|
13 | .parse(argv);
|
14 | let file;
|
15 | if (commander_1.default.args.length === 1) {
|
16 | file = commander_1.default.args[0];
|
17 | }
|
18 | else {
|
19 | console.error('invalid arguments');
|
20 | commander_1.default.help();
|
21 | process.exit(1);
|
22 | }
|
23 | const definition = await _1.generateDefinition(file);
|
24 | console.log(JSON.stringify(definition, null, 2));
|
25 | }
|
26 | exports.exec = exec;
|
27 | exec(process.argv).catch((err) => {
|
28 | console.error(err);
|
29 | process.exit(1);
|
30 | });
|
31 |
|
\ | No newline at end of file |