UNPKG

975 BPlain TextView Raw
1#!/usr/bin/env node
2
3'use strict'
4
5const program = require('commander')
6const pkg = require('../package')
7const commands = require('../lib/commands')
8
9program
10 .version(pkg[ 'version' ])
11
12program
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
24program
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
36program
37 .parse(process.argv)
38
39if (program.args.length === 0) {
40 program.help()
41}