From 0befc5dcc88b19603f384e7ce70b5db00830e3fc Mon Sep 17 00:00:00 2001 From: ps-kwang <135043922+ps-kwang@users.noreply.github.com> Date: Thu, 25 Apr 2024 16:13:55 -0400 Subject: [PATCH] fix: accept `--api-key` flag for login (#70) Closes https://github.com/Paperspace/cli/issues/52 --- commands/login/mod.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/commands/login/mod.ts b/commands/login/mod.ts index a6a572a..609f868 100644 --- a/commands/login/mod.ts +++ b/commands/login/mod.ts @@ -25,8 +25,8 @@ export const login = command("login", { args: args() .tuple([z.string().describe("An API key to log in with.")]) .optional(), -}).run(async function* ({ args }) { - let apiKey: string | undefined = args[0]; +}).run(async function* ({ args, flags }) { + let apiKey: string | undefined = args[0] ?? flags["api-key"]; if (!apiKey) { try {