MutuallyExclusiveOptions

class MutuallyExclusiveOptions<OptT : Any, OutT> : ParameterGroupDelegate<OutT>

Functions

Link copied to clipboard
fun <T> copy(transformAll: MutuallyExclusiveOptionsTransform<OptT, T>): MutuallyExclusiveOptions<OptT, T>
Link copied to clipboard
open override fun finalize(context: Context, invocationsByOption: Map<Option, List<OptionParser.Invocation>>)

Called after this command's argv is parsed and all options are validated to validate the group constraints.

Link copied to clipboard
open fun getValue(thisRef: CliktCommand, property: KProperty<*>): OutT
Link copied to clipboard
open fun parameterHelp(context: Context): HelpFormatter.ParameterHelp.Group?
Link copied to clipboard
open override fun postValidate(context: Context)

Called after all of a command's parameters have been finalized to perform validation of the final values.

Link copied to clipboard
open operator override fun provideDelegate(thisRef: CliktCommand, prop: KProperty<*>): <ERROR CLASS><CliktCommand, OutT>

Implementations must call CliktCommand.registerOptionGroup

Properties

Link copied to clipboard
open override val groupHelp: String?

A help message to display for this group.

Link copied to clipboard
open override val groupName: String?

The name of the group, or null if parameters in the group should not be separated from other parameters in the help output.

Extensions

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 <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> 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