diff --git a/std/flags/mod.ts b/std/flags/mod.ts index 09b5afa8ae..05aeff6f22 100644 --- a/std/flags/mod.ts +++ b/std/flags/mod.ts @@ -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; } diff --git a/std/flags/parse_test.ts b/std/flags/parse_test.ts index 9a19e5634c..3e981a43a9 100755 --- a/std/flags/parse_test.ts +++ b/std/flags/parse_test.ts @@ -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,