From 8648c6d7f43f3dfcc293bcb5b160dd91366dd4e3 Mon Sep 17 00:00:00 2001 From: Tim Reichen Date: Fri, 2 Aug 2024 04:43:11 +0200 Subject: [PATCH] refactor(cli): simplify `argv` and `notFlags` push (#5608) initial commit Co-authored-by: Asher Gomez --- cli/parse_args.ts | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/cli/parse_args.ts b/cli/parse_args.ts index 6d200120a48c..47569bb82af5 100644 --- a/cli/parse_args.ts +++ b/cli/parse_args.ts @@ -768,14 +768,9 @@ export function parseArgs< } if (doubleDash) { - argv["--"] = []; - for (const key of notFlags) { - argv["--"].push(key); - } + argv["--"] = notFlags; } else { - for (const key of notFlags) { - argv._.push(key); - } + argv._.push(...notFlags); } return argv as Args;