Skip to content

Add support for defining default values for flags

Choose a tag to compare

@thetutlage thetutlage released this 01 Oct 10:12

Moving forward one will be able to define default values (can be async) for the flags. Consider the following example

class MyCommand {

  @flags.string({
    description: 'The main HTML file that will be requested',
    async defaultValue(command: Greet) {
      return await command.prompt.ask('Define entrypoint as we detected multiple?')
    },
  })
  public entrypoint: string   

}

Commits

  • feat: add support for defining default values for flags b3ec17e
  • refactor: improve error messages c92d532

v7.0.2...v7.1.0