-
Notifications
You must be signed in to change notification settings - Fork 8
/
dsc.sh
executable file
·30 lines (25 loc) · 807 Bytes
/
dsc.sh
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
#!/usr/bin/env node
var program = require('commander');
var {DocScript} = require('./docscript.js');
var fs = require('fs');
program
.arguments('<file>')
// .option('-u, --username <username>', 'The user to authenticate as')
// .option('-p, --password <password>', 'The user\'s password')
.action(function(file) {
// console.log('user: %s pass: %s file: %s',
// program.username, program.password, file);
// console.log(`${file}`);
// DocScript.compile();
fs.readFile(file, 'utf8', function(err, data) {
if (err) {
return console.log(err);
}
// console.log(DocScript.api());
console.log(DocScript.compile(data));
});
});
program.parse(process.argv);
if (process.argv.length == 2) {
// TODO(goto): read from stdin to enable pipes.
}