cli-options.js 278 B

1234567891011
  1. const re = /^dotenv_config_(encoding|path|debug|override)=(.+)$/
  2. module.exports = function optionMatcher (args) {
  3. return args.reduce(function (acc, cur) {
  4. const matches = cur.match(re)
  5. if (matches) {
  6. acc[matches[1]] = matches[2]
  7. }
  8. return acc
  9. }, {})
  10. }