Package com.github.ajalt.clikt.parameters.groups

Types

Link copied to clipboard
class ChoiceGroup<GroupT : OptionGroup, OutT> : ParameterGroupDelegate<OutT>
Link copied to clipboard
class CoOccurringOptionGroup<GroupT : OptionGroup, OutT> : ParameterGroupDelegate<OutT>
Link copied to clipboard
typealias CoOccurringOptionGroupTransform<GroupT, OutT> = (occurred: Boolean?, GroupT, context: Context) -> OutT
Link copied to clipboard
class MutuallyExclusiveOptions<OptT : Any, OutT> : ParameterGroupDelegate<OutT>
Link copied to clipboard
Link copied to clipboard
class MutuallyExclusiveOptionTransformContext(context: Context)
Link copied to clipboard
open class OptionGroup(name: String?, help: String?) : ParameterGroup, ParameterHolder

A group of options that can be shown together in help output, or restricted to be cooccurring.

Link copied to clipboard
interface ParameterGroup
Link copied to clipboard
interface ParameterGroupDelegate<out T> : ParameterGroup

Functions

Link copied to clipboard
fun <T : OptionGroup> T.cooccurring(): CoOccurringOptionGroup<T, T?>

Make this group a co-occurring group.

Link copied to clipboard
fun <T : Any> MutuallyExclusiveOptions<T, T?>.default(value: T): MutuallyExclusiveOptions<T, T>

If none of the options in a mutuallyExclusiveOptions group are given on the command line, us value for the group.

Link copied to clipboard
fun <T : OptionGroup> ChoiceGroup<T, T?>.defaultByName(name: String): ChoiceGroup<T, T>

If a groupChoice or groupSwitch option is not called on the command line, use the value of the group with a switch or choice name.

Link copied to clipboard
fun <T : OptionGroup> RawOption.groupChoice(vararg choices: <ERROR CLASS><String, T>): ChoiceGroup<T, T?>
fun <T : OptionGroup> RawOption.groupChoice(choices: Map<String, T>): ChoiceGroup<T, T?>

Convert the option to an option group based on a fixed set of values.

Link copied to clipboard
fun <T : OptionGroup> RawOption.groupSwitch(vararg choices: <ERROR CLASS><String, T>): ChoiceGroup<T, T?>
fun <T : OptionGroup> RawOption.groupSwitch(choices: Map<String, T>): ChoiceGroup<T, T?>

Convert the option into a set of flags that each map to an option group.

Link copied to clipboard
fun <OptT : Any, OutT> MutuallyExclusiveOptions<OptT, OutT>.help(name: String, help: String): MutuallyExclusiveOptions<OptT, OutT>

Set the name and help for this option.

Link copied to clipboard
fun <T : Any> ParameterHolder.mutuallyExclusiveOptions(option1: OptionDelegate<out T?>, option2: OptionDelegate<out T?>, vararg options: OptionDelegate<out T?>, name: String? = null, help: String? = null): MutuallyExclusiveOptions<T, T?>

Declare a set of two or more mutually exclusive options.

Link copied to clipboard
operator fun <T : OptionGroup> T.provideDelegate(thisRef: CliktCommand, prop: KProperty<*>): <ERROR CLASS><CliktCommand, T>
Link copied to clipboard
fun <T : OptionGroup> ChoiceGroup<T, T?>.required(): ChoiceGroup<T, T>

If a groupChoice or groupSwitch option is not called on the command line, throw a MissingOption exception.

fun <T : Any> MutuallyExclusiveOptions<T, T?>.required(): MutuallyExclusiveOptions<T, T>

Make a mutuallyExclusiveOptions group required. If none of the options in the group are given, a UsageError is thrown.

Link copied to clipboard
fun <T : Any> MutuallyExclusiveOptions<T, T?>.single(): MutuallyExclusiveOptions<T, T?>

If more than one of the group's options are given on the command line, throw a MutuallyExclusiveGroupException