Skip to content

Commit

Permalink
fix: set defaultHelp on duration flag
Browse files Browse the repository at this point in the history
  • Loading branch information
mdonnalley committed Mar 13, 2024
1 parent 10bf281 commit 85a502a
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/flags/duration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,11 @@ export const durationFlag = Flags.custom<Duration, DurationFlagConfig>({
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 => {
Expand Down

0 comments on commit 85a502a

Please sign in to comment.