commandDispatcher: only argv if starts with - and has =

This commit is contained in:
Cynthia Foxwell 2022-12-10 15:25:39 -07:00
parent 35c39863e0
commit a15e4c9d1d

View file

@ -32,7 +32,7 @@ function parseAsArgv(argv) {
? removeStartHyphens(arg) ? removeStartHyphens(arg)
: removeStartHyphens(arg.slice(0, equalsIndex)); : removeStartHyphens(arg.slice(0, equalsIndex));
if (equalsIndex !== -1) { if (equalsIndex !== -1 && arg.charAt(0) === "-") {
optional[argName] = convertIfApplicable(arg.slice(equalsIndex + 1)); optional[argName] = convertIfApplicable(arg.slice(equalsIndex + 1));
} else if (arg.charAt(0) === "-") { } else if (arg.charAt(0) === "-") {
if (arg.charAt(1) === "-") { if (arg.charAt(1) === "-") {