OptionGroup

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.

Declare a subclass with option delegate properties, then use an instance of your subclass is a delegate property in your command with provideDelegate.

Example:

class UserOptions : OptionGroup(name = "User Options", help = "Options controlling the user") {
val name by option()
val age by option().int()
}

class Tool : CliktCommand() {
val userOptions by UserOptions()
}

Constructors

Link copied to clipboard
fun OptionGroup(name: String? = null, help: String? = null)

Functions

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 parameterHelp(context: Context): HelpFormatter.ParameterHelp.Group?
Link copied to clipboard
open override fun postValidate(context: Context): <ERROR CLASS>

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

Link copied to clipboard
open override fun registerOption(option: GroupableOption)

Register an option with this command or group.

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.