option

fun option(cliOption: CommanderOption)(source)

Add an option to the command

Since

0.1.0

Parameters

cliOption

The option to add


Add an option to the command

Since

0.1.0

Parameters

init

The init function to create the option


fun option(name: String, aliases: Array<String> = arrayOf(), shortAliases: Array<String> = arrayOf(), description: String? = null, required: Boolean = false, hasValue: Boolean = false, defaultValue: String? = null, valueName: String? = null, valueDescription: String? = null, valueValidator: CommanderValueValidator? = null)(source)

Add an option to the command

Since

0.1.0

Parameters

name

The name of the option

aliases

The aliases of the option

shortAliases

The short aliases of the option

description

The description of the option

required

If the option is required

hasValue

If the option has a value

defaultValue

The default value of the option

valueName

The value name of the option

valueDescription

The value description of the option

valueValidator

The value validator of the option