j
This commit is contained in:
parent
013b7321f1
commit
cc0105dec3
1 changed files with 3 additions and 1 deletions
|
|
@ -48,6 +48,8 @@ for(var i = 1; i < ARGV.length; i++) {
|
||||||
if(pmake.options[args[0]]) {
|
if(pmake.options[args[0]]) {
|
||||||
var opts = pmake.options[args[0]].options;
|
var opts = pmake.options[args[0]].options;
|
||||||
|
|
||||||
|
if(!opts) opts = [];
|
||||||
|
|
||||||
if(opts) {
|
if(opts) {
|
||||||
if((typeof opts) == "function") opts = opts();
|
if((typeof opts) == "function") opts = opts();
|
||||||
}
|
}
|
||||||
|
|
@ -55,7 +57,7 @@ for(var i = 1; i < ARGV.length; i++) {
|
||||||
if(opts && !args[1]) {
|
if(opts && !args[1]) {
|
||||||
console.log("Error: no value specified for option '" + args[0] + "'");
|
console.log("Error: no value specified for option '" + args[0] + "'");
|
||||||
process.exit(1);
|
process.exit(1);
|
||||||
} else if(opts && !opts.includes(args[1])) {
|
} else if(opts.length > 0 && !opts.includes(args[1])) {
|
||||||
console.log("Error: invalid value '" + args[1] + "' for option '" + args[0] + "'");
|
console.log("Error: invalid value '" + args[1] + "' for option '" + args[0] + "'");
|
||||||
process.exit(1);
|
process.exit(1);
|
||||||
} else if(opts) {
|
} else if(opts) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue