deprecated

fun <T> FlagOption<T>.deprecated(message: String? = "", tagName: String? = "deprecated", tagValue: String = "", error: Boolean = false): OptionDelegate<T>

Mark this option as deprecated in the help output.

By default, a tag is added to the help message and a warning is printed if the option is used.

This should be called after any validation.

Parameters

message

The message to show in the warning or error. If null, no warning is issued.

tagName

The tag to add to the help message

tagValue

An extra message to add to the tag

error

If true, when the option is invoked, a CliktError is raised immediately instead of issuing a warning.

fun <AllT, EachT, ValueT> OptionWithValues<AllT, EachT, ValueT>.deprecated(message: String? = "", tagName: String? = "deprecated", tagValue: String = "", error: Boolean = false): OptionDelegate<AllT>

Mark this option as deprecated in the help output.

By default, a tag is added to the help message and a warning is printed if the option is used.

This should be called after any conversion and validation.

Example:

val opt by option().int().validate { require(it % 2 == 0) { "value must be even" } }
.deprecated("WARNING: --opt is deprecated, use --new-opt instead")

Parameters

message

The message to show in the warning or error. If null, no warning is issued.

tagName

The tag to add to the help message

tagValue

An extra message to add to the tag

error

If true, when the option is invoked, a CliktError is raised immediately instead of issuing a warning.