-
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathcli.js
More file actions
executable file
·31 lines (23 loc) · 624 Bytes
/
cli.js
File metadata and controls
executable file
·31 lines (23 loc) · 624 Bytes
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
#!/usr/bin/env node
'use strict'
const htmlcompile = require('.')
const pkg = require('./package.json')
const argv = process.argv.slice(2)
if (argv.indexOf('--version') !== -1 || argv.indexOf('-v') !== -1) {
console.log(pkg.version)
process.exit(0)
}
if (argv.indexOf('--help') !== -1 || argv.indexOf('-h') !== -1) {
console.log(`
Usage:
$ htmlcompile <input> [<output>] [<options>]
Options:
-h, --help Display help information
-v, --version Output version
Examples:
$ htmlcompile src
$ htmlcompile src dist
`)
process.exit(0)
}
htmlcompile(argv[0], argv[1])