From 0e65453dacb68a90f4af2387e571edbd4077ba1b Mon Sep 17 00:00:00 2001 From: Mike Donnalley Date: Thu, 17 Mar 2022 09:03:35 -0600 Subject: [PATCH] fix: use OptionFlag interface so that exactlyOne can be used --- src/flags/duration.ts | 2 +- src/flags/orgFlags.ts | 10 +++++----- src/flags/salesforceId.ts | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/flags/duration.ts b/src/flags/duration.ts index 185eec950..f7f1d36f3 100644 --- a/src/flags/duration.ts +++ b/src/flags/duration.ts @@ -13,7 +13,7 @@ const messages = Messages.loadMessages('@salesforce/sf-plugins-core', 'messages' type DurationUnit = Lowercase; -export interface DurationFlagConfig extends Partial { +export interface DurationFlagConfig extends Partial> { unit: Required; defaultValue?: number; min?: number; diff --git a/src/flags/orgFlags.ts b/src/flags/orgFlags.ts index 92bbf0103..685e2e788 100644 --- a/src/flags/orgFlags.ts +++ b/src/flags/orgFlags.ts @@ -58,7 +58,7 @@ export const optionalOrgFlag = Flags.build({ char: 'e', parse: async (input: string | undefined) => await maybeGetOrg(input), default: async () => await maybeGetOrg(), - defaultHelp: async () => (await maybeGetOrg(undefined))?.getUsername(), + defaultHelp: async () => (await maybeGetOrg())?.getUsername(), }); /** @@ -83,8 +83,8 @@ export const optionalOrgFlag = Flags.build({ export const requiredOrgFlag = Flags.build({ char: 'e', parse: async (input: string | undefined) => await getOrgOrThrow(input), - default: async () => await getOrgOrThrow(undefined), - defaultHelp: async () => (await getOrgOrThrow(undefined))?.getUsername(), + default: async () => await getOrgOrThrow(), + defaultHelp: async () => (await getOrgOrThrow())?.getUsername(), }); /** @@ -109,6 +109,6 @@ export const requiredOrgFlag = Flags.build({ export const requiredHubFlag = Flags.build({ char: 'v', parse: async (input: string | undefined) => await getHubOrThrow(input), - default: async () => await getHubOrThrow(undefined), - defaultHelp: async () => (await getHubOrThrow(undefined))?.getUsername(), + default: async () => await getHubOrThrow(), + defaultHelp: async () => (await getHubOrThrow())?.getUsername(), }); diff --git a/src/flags/salesforceId.ts b/src/flags/salesforceId.ts index 9abbf3013..f7f5bfee9 100644 --- a/src/flags/salesforceId.ts +++ b/src/flags/salesforceId.ts @@ -10,7 +10,7 @@ import { Messages, sfdc } from '@salesforce/core'; Messages.importMessagesDirectory(__dirname); const messages = Messages.loadMessages('@salesforce/sf-plugins-core', 'messages'); -export interface IdFlagConfig extends Partial { +export interface IdFlagConfig extends Partial> { /** * Can specify if the version must be 15 or 18 characters long. Leave blank to allow either 15 or 18. */