clikt / com.github.ajalt.clikt.parameters.options / default

default

fun Any> FlagOption.default(value: T): FlagOption

Set a default value for a option.

fun Any, ValueT> NullableOption.default(value: EachT, defaultForHelp: String = value.toString()): OptionWithValues

If the option is not called on the command line (and is not set in an envvar), use value for the option.

This must be applied after all other transforms.

You can customize how the default is shown to the user with defaultForHelp.

Example:

``` kotlin val opt: Pair by option().int().pair().default(1 to 2)