Skip to content

Commit 85a502a

Browse files
committed
fix: set defaultHelp on duration flag
1 parent 10bf281 commit 85a502a

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/flags/duration.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,11 @@ export const durationFlag = Flags.custom<Duration, DurationFlagConfig>({
4848
typeof context.options.defaultValue === 'number'
4949
? toDuration(context.options.defaultValue, context.options.unit)
5050
: undefined,
51+
// eslint-disable-next-line @typescript-eslint/require-await
52+
defaultHelp: async (context) =>
53+
typeof context.options.defaultValue === 'number'
54+
? toDuration(context.options.defaultValue, context.options.unit).toString()
55+
: undefined,
5156
});
5257

5358
const validate = (input: string, config: DurationFlagConfig): Duration => {

0 commit comments

Comments
 (0)