Skip to content

Commit 97c124b

Browse files
flovilmartdrew-gross
authored andcommitted
Supports boolean values in cluster options (#2689)
1 parent 22c1a87 commit 97c124b

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

src/cli/cli-definitions.js

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,15 @@ function numberParser(key) {
88
}
99
}
1010

11+
function numberOrBoolParser(key) {
12+
return function(opt) {
13+
if (typeof opt === 'boolean') {
14+
return opt;
15+
}
16+
return numberParser(key)(opt);
17+
}
18+
}
19+
1120
function objectParser(opt) {
1221
if (typeof opt == 'object') {
1322
return opt;
@@ -229,6 +238,6 @@ export default {
229238
},
230239
"cluster": {
231240
help: "Run with cluster, optionally set the number of processes default to os.cpus().length",
232-
action: numberParser("cluster"),
241+
action: numberOrBoolParser("cluster")
233242
}
234243
};

0 commit comments

Comments
 (0)