UNPKG

1.21 kBPlain TextView Raw
1#!/usr/bin/env node
2
3/**
4 * Command line interface of apeman-d.
5 * This file is auto generated by ape-tmpl.
6 */
7
8"use strict";
9
10const program = require('commander'),
11 pkg = require('../package'),
12 done = require('../lib/done'),
13 apemanD = require('../lib');
14
15program
16 .version(pkg['version'])
17 .usage('[options] <action> <script> ')
18 .description(pkg['description'])
19 .option('-v, --verbose', "Show verbose logs")
20 .option('-f, --force', "Force to action")
21 .option('-c, --configuration <configuration>', "Pathname of Apemanfile")
22;
23
24
25//=========================
26// Show examples
27//=========================
28 program.on('--help', () => {
29 console.log(' Examples:');
30 console.log('');
31 console.log(' $ apeman-d start ./bin/app/ui-app.js # Start an app.');
32 console.log(' $ apeman-d stop ./bin/app/ui-app.js # Start an app.');
33 console.log('');
34});
35
36program.parse(process.argv);
37
38
39//=========================
40// Run main command
41//=========================
42
43apemanD.apply(apemanD, program.args.concat({
44 verbose: program.verbose,
45 force: program.force,
46 configuration: program.configuration
47}).concat(done));