-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.js
More file actions
executable file
·37 lines (33 loc) · 883 Bytes
/
Copy pathindex.js
File metadata and controls
executable file
·37 lines (33 loc) · 883 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!/usr/bin/env node
const yargs = require('yargs');
const { argv } = yargs
.usage('Usage: oss | oss -l | oss -e feature1 | oss -u http://10.240.177.151:8020')
.version()
.alias('v', 'version')
// 代理到测试环境
.option('env', {
alias: 'e',
describe: 'specify a test environment to connect'
})
// 代理到某个url
.option('url', {
alias: 'u',
describe: 'specify an url to connect'
})
// 代理到某个url
.option('port', {
alias: 'p',
describe: 'specify a port for mock server'
})
// 本地mock
.alias('local', 'l')
.boolean('l')
.describe('l', 'local mode,no mock server,for backend')
.alias('h', 'help')
.help('h');
let {
env, url, port, local, version, help
} = argv;
if (!version && !help) {
require('./main')(env, url, port, local);
}