toDefaulting

open fun toDefaulting(defaultValue: T, outputError: Boolean = false, signatureType: Key? = null, showTypeInSignature: Boolean? = null, errorType: Key? = null, nestedValidator: Validator<T> = null): DefaultingConverter<T>

Wrap this single converter with a SingleToDefaultingConverter, which is a special converter that will act like a DefaultingConverter using the same logic of this converter.

Your converter should be designed with this pattern in mind. If that's not possible, please override this function and throw an exception in the body.

For more information on the parameters, see Converter.

Parameters

defaultValue

The default value to use when an argument can't be converted.

outputError

Whether the argument parser should output parsing errors on invalid arguments.

signatureType

Optionally, a signature type string to use instead of the one this converter provides.

showTypeInSignature

Optionally, override this converter's setting for showing the type string in a generated command signature.

errorType

Optionally, a longer type string to be shown in errors instead of the one this converter provides.