From 88ed77461573bd682b40bbd4f4a54f50eb168e36 Mon Sep 17 00:00:00 2001 From: "c.xinyi" Date: Sat, 12 Oct 2024 19:09:34 +0800 Subject: [PATCH 1/2] fix: parameter cannot start with a hyphen --- src/_parser.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/_parser.ts b/src/_parser.ts index 2a53a0f..5253451 100644 --- a/src/_parser.ts +++ b/src/_parser.ts @@ -136,7 +136,7 @@ export function parseRawArgs( val = arg.slice(Math.max(0, ++idx)) || i + 1 === len || - ("" + args[i + 1]).charCodeAt(0) === 45 || + (("" + args[i + 1]).charCodeAt(0) === 45 && !("" + args[i + 1]).includes(' ')) || args[++i]; arr = j === 2 ? [name] : name; From af627aa6206d87c1ae6e73eb02769be1e55bed47 Mon Sep 17 00:00:00 2001 From: "autofix-ci[bot]" <114827586+autofix-ci[bot]@users.noreply.github.com> Date: Sat, 12 Oct 2024 13:54:28 +0000 Subject: [PATCH 2/2] chore: apply automated lint fixes --- src/_parser.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/_parser.ts b/src/_parser.ts index 5253451..0338101 100644 --- a/src/_parser.ts +++ b/src/_parser.ts @@ -136,7 +136,8 @@ export function parseRawArgs( val = arg.slice(Math.max(0, ++idx)) || i + 1 === len || - (("" + args[i + 1]).charCodeAt(0) === 45 && !("" + args[i + 1]).includes(' ')) || + (("" + args[i + 1]).charCodeAt(0) === 45 && + !("" + args[i + 1]).includes(" ")) || args[++i]; arr = j === 2 ? [name] : name;