/
cli-options.js
119 lines (116 loc) · 3.25 KB
/
cli-options.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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
'use strict';
var chalk = require('chalk');
var options = {
help: {
alias: 'h',
type: 'boolean',
desc: chalk.gray(
'Show this help.'),
},
version: {
alias: 'v',
type: 'boolean',
desc: chalk.gray(
'Print the global and local gulp versions.'),
},
preload: {
type: 'string',
requiresArg: true,
desc: chalk.gray(
'Will preload a module before running the gulpfile. ' +
'This is useful for transpilers but also has other applications.'),
},
gulpfile: {
alias: 'f',
type: 'string',
requiresArg: true,
desc: chalk.gray(
'Manually set path of gulpfile. Useful if you have multiple gulpfiles. ' +
'This will set the CWD to the gulpfile directory as well.'),
},
cwd: {
type: 'string',
requiresArg: true,
desc: chalk.gray(
'Manually set the CWD. The search for the gulpfile, ' +
'as well as the relativity of all requires will be from here.'),
},
tasks: {
alias: 'T',
type: 'boolean',
desc: chalk.gray(
'Print the task dependency tree for the loaded gulpfile.'),
},
'tasks-simple': {
type: 'boolean',
desc: chalk.gray(
'Print a plaintext list of tasks for the loaded gulpfile.'),
},
'tasks-json': {
desc: chalk.gray(
'Print the task dependency tree, ' +
'in JSON format, for the loaded gulpfile.'),
},
'tasks-depth': {
alias: 'depth',
type: 'number',
requiresArg: true,
default: undefined, // To detect if this cli option is specified.
desc: chalk.gray(
'Specify the depth of the task dependency tree.'),
},
'compact-tasks': {
type: 'boolean',
default: undefined, // To detect if this cli option is specified.
desc: chalk.gray(
'Reduce the output of task dependency tree by printing ' +
'only top tasks and their child tasks.'),
},
'sort-tasks': {
type: 'boolean',
default: undefined, // To detect if this cli option is specified.
desc: chalk.gray(
'Will sort top tasks of task dependency tree.'),
},
color: {
type: 'boolean',
desc: chalk.gray(
'Will force gulp and gulp plugins to display colors, ' +
'even when no color support is detected.'),
},
'no-color': {
type: 'boolean',
desc: chalk.gray(
'Will force gulp and gulp plugins to not display colors, ' +
'even when color support is detected.'),
},
silent: {
alias: 'S',
type: 'boolean',
default: undefined, // To detect if this cli option is specified.
desc: chalk.gray(
'Suppress all gulp logging.'),
},
continue: {
type: 'boolean',
default: undefined, // To detect if this cli option is specified.
desc: chalk.gray(
'Continue execution of tasks upon failure.'),
},
series: {
type: 'boolean',
default: undefined, // To detect if this cli option is specified.
desc: chalk.gray(
'Run tasks given on the CLI in series (the default is parallel).'),
},
'log-level': {
alias: 'L',
// Type isn't needed because count acts as a boolean
count: true,
default: undefined, // To detect if this cli option is specified.
desc: chalk.gray(
'Set the loglevel. -L for least verbose and -LLLL for most verbose. ' +
'-LLL is default.'),
}
};
module.exports = options;