
commonMain.com.github.ajalt.clikt.parameters.groups.ParameterGroup.kt Maven / Gradle / Ivy
package com.github.ajalt.clikt.parameters.groups
import com.github.ajalt.clikt.core.CliktCommand
import com.github.ajalt.clikt.core.Context
import com.github.ajalt.clikt.core.GroupableOption
import com.github.ajalt.clikt.core.ParameterHolder
import com.github.ajalt.clikt.output.HelpFormatter
import com.github.ajalt.clikt.parameters.options.Option
import com.github.ajalt.clikt.parsers.OptionParser
import kotlin.properties.ReadOnlyProperty
import kotlin.reflect.KProperty
interface ParameterGroup {
/**
* The name of the group, or null if parameters in the group should not be separated from other
* parameters in the help output.
*/
val groupName: String?
/**
* A help message to display for this group.
*
* If [groupName] is null, the help formatter will ignore this value.
*/
val groupHelp: String?
val parameterHelp: HelpFormatter.ParameterHelp.Group?
get() {
val n = groupName
val h = groupHelp
return if (n == null || h == null) null else HelpFormatter.ParameterHelp.Group(n, h)
}
/**
* Called after this command's argv is parsed and all options are validated to validate the group constraints.
*
* @param context The context for this parse
* @param invocationsByOption The invocations of options in this group.
*/
fun finalize(context: Context, invocationsByOption: Map
© 2015 - 2025 Weber Informatics LLC | Privacy Policy