From 85a502af1494dc21f7c119be384ba573f4099c9c Mon Sep 17 00:00:00 2001 From: Mike Donnalley Date: Wed, 13 Mar 2024 14:38:52 -0600 Subject: [PATCH] fix: set defaultHelp on duration flag --- src/flags/duration.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/flags/duration.ts b/src/flags/duration.ts index 7cf1a4a9..1c8ba3c1 100644 --- a/src/flags/duration.ts +++ b/src/flags/duration.ts @@ -48,6 +48,11 @@ export const durationFlag = Flags.custom({ typeof context.options.defaultValue === 'number' ? toDuration(context.options.defaultValue, context.options.unit) : undefined, + // eslint-disable-next-line @typescript-eslint/require-await + defaultHelp: async (context) => + typeof context.options.defaultValue === 'number' + ? toDuration(context.options.defaultValue, context.options.unit).toString() + : undefined, }); const validate = (input: string, config: DurationFlagConfig): Duration => {