1 | #!/usr/bin/env node
|
2 |
|
3 | 'use strict'
|
4 |
|
5 | const program = require('commander')
|
6 | const pkg = require('../package')
|
7 | const commands = require('../lib/commands')
|
8 |
|
9 | program
|
10 | .version(pkg[ 'version' ])
|
11 |
|
12 | program
|
13 | .command('render [bud...]')
|
14 | .description('Render files from bud.')
|
15 | .option('-v, --verbose', 'Show verbose logs.')
|
16 | .option('-c, --configuration [configuration]', 'Configuration module path.')
|
17 | .action(function (src, opitons) {
|
18 | commands.render(src, opitons)
|
19 | })
|
20 | .on('--help', function () {
|
21 | console.log(commands.render.help)
|
22 | })
|
23 |
|
24 | program
|
25 | .command('clean [bud]')
|
26 | .description('Clean files rendered from bud.')
|
27 | .option('-v, --verbose', 'Show verbose logs.')
|
28 | .option('-c, --configuration [configuration]', 'Configuration module path.')
|
29 | .action((src, opitons) => {
|
30 | commands.clean(src, opitons)
|
31 | })
|
32 | .on('--help', () => {
|
33 | console.log(commands.clean.help)
|
34 | })
|
35 |
|
36 | program
|
37 | .parse(process.argv)
|
38 |
|
39 | if (program.args.length === 0) {
|
40 | program.help()
|
41 | }
|