Package-level declarations

TODO .

Types

Link copied to clipboard
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.

Link copied to clipboard
data class Flag(val names: Set<String>, val description: String? = null, val multiple: Boolean = false, val tag: String? = null, val values: List<Boolean> = emptyList()) : Property<Boolean>
Link copied to clipboard
interface Formatter
Link copied to clipboard
data class Option<T : Any>(val type: KClass<T>, val names: Set<String>, val description: String? = null, val regex: Regex? = null, val optional: Boolean = true, val multiple: Boolean = false, val tag: String? = null, val values: List<T> = emptyList()) : Property<T>
Link copied to clipboard
data class Parameter<T : Any>(val type: KClass<T>, val name: String, val description: String? = null, val regex: Regex? = null, val optional: Boolean = true, val multiple: Boolean = false, val tag: String? = null, val values: List<T> = emptyList()) : Property<T>
Link copied to clipboard
data class Program(val version: String? = null, val command: Command, val formatter: Formatter = DefaultFormatter(), val systemSetting: Boolean = false, val defaultCommand: List<String> = emptyList())
Link copied to clipboard
sealed interface Property<T : Any>

TODO

Functions

Link copied to clipboard
inline fun <T : Any> Option(shortName: Char? = null, name: String? = null, description: String? = null, regex: Regex? = null, tag: String? = null, value: T): Option<T>
inline fun <T : Any> Option(shortName: Char? = null, name: String? = null, description: String? = null, regex: Regex? = null, tag: String? = null, values: List<T>): Option<T>
inline fun <T : Any> Option(shortName: Char? = null, name: String? = null, description: String? = null, regex: Regex? = null, optional: Boolean = true, multiple: Boolean = false, tag: String? = null): Option<T>
Link copied to clipboard
inline fun <T : Any> Parameter(name: String, description: String? = null, regex: Regex? = null, tag: String? = null, value: T): Parameter<T>
inline fun <T : Any> Parameter(name: String, description: String? = null, regex: Regex? = null, tag: String? = null, values: List<T>): Parameter<T>
inline fun <T : Any> Parameter(name: String, description: String? = null, regex: Regex? = null, optional: Boolean = true, multiple: Boolean = false, tag: String? = null): Parameter<T>