#!/usr/bin/env node /** * Command line interface of apeman-wch. * This file is auto generated by ape-tmpl. */ "use strict"; var program = require('commander'), pkg = require('../package'), done = require('../lib/done'), apemanWch = require('../lib'); program .version(pkg['version']) .usage('[options] [name...] ') .description("Watch files to trigger action.") .option('-v, --verbose', "Show verbose logs") .option('-c, --configuration ', "Pathname of Apemanfile") .option('-t, --interval ', "Milliseconds of interval to run action.") ; //========================= // Show examples //========================= program.on('--help', function(){ console.log(' Examples:'); console.log(''); console.log(' $ apeman-watch # List available watches'); console.log(' $ apeman-watch myWatch01 # Start watching.'); console.log(''); }); program.parse(process.argv); //========================= // Run main command //========================= apemanWch.apply(apemanWch, program.args.concat({ verbose: program.verbose, configuration: program.configuration, interval: program.interval }).concat(done));