From f6769a3d98a93da154eaa244286d283310bcf5c3 Mon Sep 17 00:00:00 2001 From: Asher Date: Tue, 29 Oct 2024 11:19:25 -0800 Subject: [PATCH] Name login arguments --- src/commands.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/commands.ts b/src/commands.ts index 23e30977..a5bd3eb6 100644 --- a/src/commands.ts +++ b/src/commands.ts @@ -136,8 +136,8 @@ export class Commands { * Log into the provided deployment. If the deployment URL is not specified, * ask for it first with a menu showing recent URLs and CODER_URL, if set. */ - public async login(...args: string[]): Promise { - const url = await this.maybeAskUrl(args[0]) + public async login([inputUrl, inputLabel, inputToken]: string[]): Promise { + const url = await this.maybeAskUrl(inputUrl) if (!url) { return } @@ -145,10 +145,10 @@ export class Commands { // It is possible that we are trying to log into an old-style host, in which // case we want to write with the provided blank label instead of generating // a host label. - const label = typeof args[2] === "undefined" ? toSafeHost(url) : args[2] + const label = typeof inputLabel === "undefined" ? toSafeHost(url) : inputLabel // Try to get a token from the user, if we need one, and their user. - const res = await this.maybeAskToken(url, args[1]) + const res = await this.maybeAskToken(url, inputToken) if (!res) { return // The user aborted. }