Handle kebab-case args in babel-node. (#8046)

This commit is contained in:
Logan Smyth
2018-05-25 08:40:52 -07:00
committed by GitHub
parent 90a174e7c4
commit cf8058e5b6
10 changed files with 34 additions and 1 deletions

View File

@@ -150,7 +150,10 @@ if (program.eval || program.print) {
}
if (arg[0] === "-") {
const parsedArg = program[arg.slice(2)];
const camelArg = arg
.slice(2)
.replace(/-(\w)/, (s, c) => c.toUpperCase());
const parsedArg = program[camelArg];
if (
arg === "-r" ||
arg === "--require" ||