summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--std/flags/mod.ts2
-rwxr-xr-xstd/flags/parse_test.ts6
2 files changed, 7 insertions, 1 deletions
diff --git a/std/flags/mod.ts b/std/flags/mod.ts
index 09b5afa8a..05aeff6f2 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 9a19e5634..3e981a43a 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,