securityos/node_modules/minimisted/index.js

14 lines
473 B
JavaScript
Raw Normal View History

2024-09-06 15:32:35 +00:00
'use strict'
/**
* Calls the given function with the minimist-parsed command line options and exit the process with the returned number of the main function.
* @param {Function} main The main function of the cli
* @param {Object} opts The options
* @param {string[]} argv The command line arguments. Default is process.argv.slice(2).
*/
module.exports = (main, opts, argv) => {
argv = argv || process.argv.slice(2)
return main(require('minimist')(argv, opts))
}