forked from vidartf/widget-gen
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.js
27 lines (22 loc) · 864 Bytes
/
main.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
#!/usr/bin/env node
require('source-map-support').install()
const program = require('commander');
const run = require('./lib/run').run;
const version = require('./package.json').version;
program
.version(version)
// TODO: Add valid parser names automatically:
.option('-p, --parser [parser]', 'The name of the parser to use, either "json" or "python".')
.option('-o, --outputdir [outputdir]', 'The output directory.')
.option('-t, --template [template]', 'a template file to use.')
.option('-e, --extension [extension]', 'The file extension to use for the output.')
.arguments('<file> [languages...]')
.action(function(file, languages, cmd) {
run(file, languages || ['python'], {
output: cmd.outputdir,
parserName: cmd.parser,
templateFile: cmd.template,
fileExt: cmd.extension,
});
})
.parse(process.argv)