Skip to content

Commit

Permalink
Merge pull request #514 from salesforcecli/mdonnalley/duration-defaul…
Browse files Browse the repository at this point in the history
…t-help

fix: set defaultHelp on duration flag
  • Loading branch information
shetzel committed Mar 19, 2024
2 parents 10bf281 + 85a502a commit e6e9322
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 e6e9322

Please sign in to comment.