Supports boolean values in cluster options (#2689)

This commit is contained in:
Florent Vilmart
2016-09-17 15:45:13 -04:00
committed by Drew
parent 22c1a87d80
commit 97c124bbbe

View File

@@ -8,6 +8,15 @@ function numberParser(key) {
}
}
function numberOrBoolParser(key) {
return function(opt) {
if (typeof opt === 'boolean') {
return opt;
}
return numberParser(key)(opt);
}
}
function objectParser(opt) {
if (typeof opt == 'object') {
return opt;
@@ -229,6 +238,6 @@ export default {
},
"cluster": {
help: "Run with cluster, optionally set the number of processes default to os.cpus().length",
action: numberParser("cluster"),
action: numberOrBoolParser("cluster")
}
};