Command

data class Command(val name: String, val title: String? = null, val description: String? = null, val properties: Set<Property<*>> = emptySet(), val subcommands: Set<Command> = emptySet())

A program can have multiple commands with their own set of options and positional parameters.

TODO Support aliases

Constructors

Link copied to clipboard
constructor(name: String, title: String? = null, description: String? = null, properties: Set<Property<*>> = emptySet(), subcommands: Set<Command> = emptySet())

Properties

Link copied to clipboard
val description: String? = null
Link copied to clipboard
val flags: Set<Flag>
Link copied to clipboard
val name: String
Link copied to clipboard
val options: Set<Option<*>>
Link copied to clipboard
val optionsMap: Map<String, Option<*>>
Link copied to clipboard
val parameters: Set<Parameter<*>>
Link copied to clipboard
val parametersMap: Map<String, Parameter<*>>
Link copied to clipboard
val properties: Set<Property<*>>
Link copied to clipboard
val propertiesMap: Map<String, Property<*>>
Link copied to clipboard
Link copied to clipboard
val subcommandsMap: Map<String, Command>
Link copied to clipboard
val title: String? = null

Functions

Link copied to clipboard
fun contains(flag: Flag, args: Iterable<String>): Boolean
Link copied to clipboard
fun findCommand(args: Iterable<String>): Command
Link copied to clipboard
fun parse(args: List<String>): Command
Link copied to clipboard
fun <T : Any> propertyValue(name: String): T
Link copied to clipboard
fun <T : Any> propertyValueOrNull(name: String): T?
Link copied to clipboard
fun <T : Any> propertyValues(name: String): List<T>