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

deprecated

fun FlagOption.deprecated(message: String? = “”, tagName: String? = “deprecated”, tagValue: String = “”, error: Boolean = false): OptionDelegate

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 OptionWithValues.deprecated(message: String? = “”, tagName: String? = “deprecated”, tagValue: String = “”, error: Boolean = false): OptionDelegate

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.