-
Notifications
You must be signed in to change notification settings - Fork 4
/
lacuna.js
36 lines (28 loc) · 1.13 KB
/
lacuna.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
/**
* Commandline entrypoint of LacunaJS
*/
'use strict';
require("./prototype_extension");
const logger = require("./_logger");
const lacuna = require("./lacuna_runner");
const commandLineArgs = require('command-line-args');
/* Fetch runOptions from command line */
let argv = null;
try {
argv = commandLineArgs([
{ name: 'directory', type: String, defaultOption: true }, // obviously has no default option
{ name: 'analyzer', type: String, multiple: true, alias: 'a' },
{ name: 'entry', type: String, alias: 'e' },
{ name: 'olevel', type: Number, alias: 'o' },
{ name: 'logfile', type: String, alias: 'l' },
{ name: 'timeout', type: Number, alias: 't' },
{ name: 'force', type: Boolean, alias: 'f' },
{ name: 'destination', type: String, alias: 'd' },
{ name: 'normalizeOnly', type: Boolean },
{ name: 'assumeNormalization', type: Boolean }
]);
} catch (e) { throw logger.error(e); }
if (!argv) { throw logger.error("Invalid commandLineArgs"); }
/* Actual startup of lacuna */
try { lacuna.run(argv, function(log) { }); }
catch (e) { console.log(e); }