UsageError

open class UsageError : CliktError

An internal exception that signals a usage error.

The option and argument properties are used in message formatting, and can be set after the exception is created. If this is thrown inside a call to convert, the argument or option value will be set automatically

Constructors

Link copied to clipboard
fun UsageError(text: String, paramName: String? = null, context: Context? = null, statusCode: Int = 1)
Link copied to clipboard
fun UsageError(text: String, argument: Argument, context: Context? = null, statusCode: Int = 1)
Link copied to clipboard
fun UsageError(text: String, option: Option, context: Context? = null, statusCode: Int = 1)

Functions

Link copied to clipboard

Properties

Link copied to clipboard
var argument: Argument? = null

The argument that caused this error. This may be set after the error is thrown.

Link copied to clipboard
open val cause: Throwable?
Link copied to clipboard
var context: Context? = null
Link copied to clipboard
open override val message: String?
Link copied to clipboard
var option: Option? = null

The option that caused this error. This may be set after the error is thrown.

Link copied to clipboard
var paramName: String? = null

The name of the parameter that caused the error. If possible, this should be set to the actual name used. If not set, it will be inferred from argument or option if either is set.

Link copied to clipboard
val statusCode: Int = 1

The value to use as the exit code for the process. If you use CliktCommand.main, it will pass this value to exitProcess after printing message. Defaults to 1.

Link copied to clipboard
val text: String? = null

Extra text to add to the message. Not all subclasses uses this.

Inheritors

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard