-
Notifications
You must be signed in to change notification settings - Fork 19
/
parse_args.js
47 lines (46 loc) · 1.03 KB
/
parse_args.js
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
38
39
40
41
42
43
44
45
46
47
const yargs = require('yargs');
module.exports.argv = yargs
.option('host', {
demandOption: false,
default: '0.0.0.0',
describe: 'Server host',
type: 'string'
})
.option('port', {
demandOption: false,
default: '15500',
describe: 'Server port',
type: 'number'
})
.option('keep-comments', {
demandOption: false,
default: true,
describe: 'Keep comments in the HTML output',
type: 'boolean'
})
.option('beautify', {
demandOption: false,
default: false,
describe: 'Beautify the HTML output',
type: 'boolean'
})
.option('minify', {
demandOption: false,
default: false,
describe: 'Minify the HTML output',
type: 'boolean'
})
.option('validation-level', {
demandOption: false,
default: 'soft',
describe: 'Available values for the validator',
type: 'string',
choices: ['strict', 'soft', 'skip']
})
.option('max-body', {
demandOption: false,
default: '1mb',
describe: 'Max size of the http body',
type: 'string'
})
.argv;