1 | #!/usr/bin/env node
|
2 |
|
3 | /**
|
4 | * Command line interface of apeman-wch.
|
5 | * This file is auto generated by ape-tmpl.
|
6 | */
|
7 |
|
8 | "use strict";
|
9 |
|
10 | var program = require('commander'),
|
11 | pkg = require('../package'),
|
12 | done = require('../lib/done'),
|
13 | apemanWch = require('../lib');
|
14 |
|
15 | program
|
16 | .version(pkg['version'])
|
17 | .usage('[options] [name...] ')
|
18 | .description("Watch files to trigger action.")
|
19 | .option('-v, --verbose', "Show verbose logs")
|
20 | .option('-c, --configuration <configuration>', "Pathname of Apemanfile")
|
21 | .option('-t, --interval <interval>', "Milliseconds of interval to run action.")
|
22 | ;
|
23 |
|
24 |
|
25 | //=========================
|
26 | // Show examples
|
27 | //=========================
|
28 | program.on('--help', function(){
|
29 | console.log(' Examples:');
|
30 | console.log('');
|
31 | console.log(' $ apeman-watch # List available watches');
|
32 | console.log(' $ apeman-watch myWatch01 # Start watching.');
|
33 | console.log('');
|
34 | });
|
35 |
|
36 | program.parse(process.argv);
|
37 |
|
38 |
|
39 | //=========================
|
40 | // Run main command
|
41 | //=========================
|
42 |
|
43 | apemanWch.apply(apemanWch, program.args.concat({
|
44 | verbose: program.verbose,
|
45 | configuration: program.configuration,
|
46 | interval: program.interval
|
47 | }).concat(done));
|