Skip to content

Commit

Permalink
add simultaneous option to cli
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffbski committed Jan 7, 2020
1 parent 0840c86 commit cbf2f42
Showing 1 changed file with 19 additions and 10 deletions.
29 changes: 19 additions & 10 deletions bin/wait-on
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,15 @@ var path = require('path');
var waitOn = require('../');

var minimistOpts = {
string: ['c', 'd', 'i', 't', 'w', 'httpTimeout', 'tcpTimeout'],
string: ['c', 'd', 'i', 's', 't', 'w', 'httpTimeout', 'tcpTimeout'],
boolean: ['h', 'l', 'r', 'v'],
alias: {
c: 'config',
d: 'delay',
i: 'interval',
l: 'log',
r: 'reverse',
s: 'simultaneous',
t: 'timeout',
v: 'verbose',
w: 'window',
Expand Down Expand Up @@ -43,15 +44,23 @@ if (argv.help || !argv._.length) {
opts.resources = argv._;

// now check for specific options and set those
opts = ['delay', 'httpTimeout', 'interval', 'log', 'reverse', 'timeout', 'tcpTimeout', 'verbose', 'window'].reduce(
function(accum, x) {
if (argv[x]) {
accum[x] = argv[x];
}
return accum;
},
opts
);
opts = [
'delay',
'httpTimeout',
'interval',
'log',
'reverse',
'simultaneous',
'timeout',
'tcpTimeout',
'verbose',
'window'
].reduce(function(accum, x) {
if (argv[x]) {
accum[x] = argv[x];
}
return accum;
}, opts);

waitOn(opts, function(err) {
if (err) {
Expand Down

0 comments on commit cbf2f42

Please sign in to comment.