wallet-core/node_modules/flagged-respawn/lib/reorder.js

17 lines
338 B
JavaScript
Raw Normal View History

2016-10-10 03:43:44 +02:00
module.exports = function (flags, argv) {
if (!argv) {
argv = process.argv;
}
var args = [argv[1]];
argv.slice(2).forEach(function (arg) {
var flag = arg.split('=')[0];
if (flags.indexOf(flag) !== -1) {
args.unshift(arg);
} else {
args.push(arg);
}
});
args.unshift(argv[0]);
return args;
};