#!/usr/bin/env node /** * Command line interface of apeman-dply. * This file is auto generated by ape-tmpl. */ "use strict"; const program = require('commander'), pkg = require('../package'), done = require('../lib/done'), apemanDply = require('../lib'); program .version(pkg['version']) .usage('[options] [name...] ') .description("Deploy project on docker.") .option('-v, --verbose', "Show verbose logs") .option('-f, --force', "Force to remove container.") .option('-d, --delete', "Remove container.") .option('-c, --configuration ', "Pathname of Apemanfile") .option('-l, --list', "List available watches") .option('-t, --tty', "Open terminal for dply") .option('-r, --rerun', "Delete and execute deploying again.") .option('-e, --exec ', "Execute a command inside container.") .option('-p, --print', "Print container log.") .option('-P, --printon', "Print and follow container log.") ; //========================= // Show examples //========================= program.on('--help', () => { console.log(' Examples:'); console.log(''); console.log(' $ apeman-dply # Execute deploying defined in $dplys prop.'); console.log(' $ apeman-dply -l # List available deploy.'); console.log(' $ apeman-dply -t node # Open terminal for a deploy.'); console.log(' $ apeman-dply "node*" # Execute deploy which match pattern.'); console.log(' $ apeman-dply -d # Remove all deploy defined in $infra prop.'); console.log(''); }); program.parse(process.argv); //========================= // Run main command //========================= apemanDply.apply(apemanDply, program.args.concat({ verbose: program.verbose, force: program.force, delete: program.delete, configuration: program.configuration, list: program.list, tty: program.tty, rerun: program.rerun, exec: program.exec, print: program.print, printon: program.printon }).concat(done));