1 | /* @flow */
|
2 |
|
3 | const re = /^dotenv_config_(encoding|path|debug)=(.+)$/
|
4 |
|
5 | module.exports = function optionMatcher (args /*: Array<string> */) {
|
6 | return args.reduce(function (acc, cur) {
|
7 | const matches = cur.match(re)
|
8 | if (matches) {
|
9 | acc[matches[1]] = matches[2]
|
10 | }
|
11 | return acc
|
12 | }, {})
|
13 | }
|