commandDispatcher: try 3
This commit is contained in:
parent
d920d334a2
commit
a8310dda03
1 changed files with 2 additions and 2 deletions
|
@ -16,7 +16,7 @@ function convertIfApplicable(val) {
|
|||
}
|
||||
|
||||
function removeStartHyphens(val) {
|
||||
return val.replace(/^-+/g, "");
|
||||
return val.replace(/^--?/g, "");
|
||||
}
|
||||
|
||||
// taken from ethanent/gar
|
||||
|
@ -28,7 +28,7 @@ function parseAsArgv(argv) {
|
|||
for (const arg of argv) {
|
||||
const equalsIndex = arg.indexOf("=");
|
||||
const argName =
|
||||
equalsIndex === -1 && arg.charAt(0) === "-"
|
||||
equalsIndex === -1 && arg.charAt(0) !== "-"
|
||||
? removeStartHyphens(arg)
|
||||
: removeStartHyphens(arg.slice(0, equalsIndex));
|
||||
|
||||
|
|
Loading…
Reference in a new issue