市场夺宝奇兵
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

17 lines
385 B

  1. const re = /^dotenv_config_(encoding|path|quiet|debug|override|DOTENV_KEY)=(.+)$/
  2. module.exports = function optionMatcher (args) {
  3. const options = 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. if (!('quiet' in options)) {
  11. options.quiet = 'true'
  12. }
  13. return options
  14. }