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:
parent
93deefcae2
commit
43d4978cea
2 changed files with 7 additions and 1 deletions
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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,
|
||||
|
|
Loading…
Reference in a new issue