-
Notifications
You must be signed in to change notification settings - Fork 38
Expand file tree
/
Copy pathgroups.js
More file actions
50 lines (47 loc) · 945 Bytes
/
groups.js
File metadata and controls
50 lines (47 loc) · 945 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
38
39
40
41
42
43
44
45
46
47
48
49
50
import commandLineUsage from 'command-line-usage'
const optionDefinitions = [
{
name: 'help',
description: 'Display this usage guide.',
alias: 'h',
type: Boolean,
group: 'main'
},
{
name: 'src',
description: 'The input files to process',
multiple: true,
defaultOption: true,
typeLabel: '{underline file} ...',
group: 'input'
},
{
name: 'timeout',
description: 'Timeout value in ms',
alias: 't',
typeLabel: '{underline ms}',
group: 'main'
},
{
name: 'plugin',
description: 'A plugin path',
type: String
}
]
const sections = [
{
header: 'A typical app',
content: 'Generates something {italic very} important.'
},
{
header: 'Main options',
optionList: optionDefinitions,
group: [ 'main', 'input' ]
},
{
header: 'Misc',
optionList: optionDefinitions,
group: '_none'
}
]
console.log(commandLineUsage(sections))