1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2025-01-08 15:19:40 -05:00

fix(std/flags): Fix parse incorrectly parsing alias flags with equals signs in the value #8136 (#8216)

This commit is contained in:
The Wizard Bear 2020-11-02 22:17:26 +00:00 committed by GitHub
parent 93deefcae2
commit 43d4978cea
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 1 deletions

View file

@ -277,7 +277,7 @@ export function parse(
}
if (/[A-Za-z]/.test(letters[j]) && /=/.test(next)) {
setArg(letters[j], next.split("=")[1], arg);
setArg(letters[j], next.split(/=(.+)/)[1], arg);
broken = true;
break;
}

View file

@ -26,6 +26,9 @@ Deno.test("comprehensive", function (): void {
"--bool",
"--no-meep",
"--multi=baz",
"-f=abc=def",
"--foo=---=\\n--+34-=/=",
"-e==",
"--",
"--not-a-flag",
"eek",
@ -34,6 +37,9 @@ Deno.test("comprehensive", function (): void {
c: true,
a: true,
t: true,
e: "=",
f: "abc=def",
foo: "---=\\n--+34-=/=",
s: "woo",
h: "awesome",
b: true,