1 | #!/usr/bin/env node
|
2 |
|
3 | 'use strict';
|
4 |
|
5 | const program = require('commander');
|
6 | const writer = require('./writer.js');
|
7 | const pckage = require('../package.json');
|
8 |
|
9 | program.version(pckage.version);
|
10 |
|
11 |
|
12 |
|
13 |
|
14 |
|
15 |
|
16 | program
|
17 | .command('write')
|
18 | .description('write an asset feed')
|
19 | .option('-s, --source <source>', 'source file to read')
|
20 | .option('-d, --destination <destination>', 'destination to write too')
|
21 | .action(writer.js)
|
22 | .on('--help', writer.help);
|
23 |
|
24 | program.on('--help', () => {
|
25 |
|
26 | console.log(' Help here:');
|
27 | });
|
28 |
|
29 | if (!process.argv.slice(2).length) {
|
30 | program.outputHelp();
|
31 | process.exit();
|
32 | }
|
33 |
|
34 | program.parse(process.argv);
|