1 | #!/usr/bin/env node
|
2 |
|
3 |
|
4 |
|
5 | 'use strict';
|
6 |
|
7 | const program = require('commander');
|
8 | const debug = require('debug');
|
9 |
|
10 | program
|
11 | .version(require('../package.json').version, '--version')
|
12 | .description(`The fun command line provides a complete set of commands to define, develop,
|
13 | test serverless applications locally, and deploy them to the Alibaba Cloud.`)
|
14 | .option('-v, --verbose', 'verbose output', (_, total) => total + 1, 0)
|
15 |
|
16 |
|
17 |
|
18 |
|
19 |
|
20 | .command('config', 'Configure the fun')
|
21 | .command('init', 'Initialize a new fun project')
|
22 | .command('install', 'Install dependencies which are described in fun.yml')
|
23 | .command('build', 'Build the dependencies')
|
24 | .command('local', 'Run your serverless application locally')
|
25 | .command('edge', 'Run your serverless application at edge')
|
26 | .command('validate', 'Validate a fun template')
|
27 | .command('deploy', 'Deploy a fun application')
|
28 | .command('nas', 'Operate NAS file system')
|
29 | .command("package", 'Package a Function Compute application')
|
30 | .command('invoke', 'Remote invoke function');
|
31 |
|
32 | process.env.FUN_VERBOSE = 0;
|
33 |
|
34 | program.on('option:verbose', () => {
|
35 | if (program.verbose === 4) {
|
36 | debug.enable('*');
|
37 | }
|
38 | process.env.FUN_VERBOSE = program.verbose;
|
39 | });
|
40 |
|
41 | require('../lib/utils/command').registerCommandChecker(program);
|
42 |
|
43 | program.parse(process.argv); |
\ | No newline at end of file |