Package com.github.ajalt.clikt.core

Types

Abort
Link copied to clipboard
common
class Abort(error: Boolean) : RuntimeException
An internal error that signals Clikt to abort.
BadParameterValue
Link copied to clipboard
common
class BadParameterValue : UsageError
A parameter was given the correct number of values, but of invalid format or type.
CliktCommand
Link copied to clipboard
common
abstract class CliktCommand(help: String, epilog: String, name: String?, invokeWithoutSubcommand: Boolean, printHelpOnEmptyArgs: Boolean, helpTags: Map<String, String>, autoCompleteEnvvar: String?, allowMultipleSubcommands: Boolean, treatUnknownOptionsAsArgs: Boolean) : ParameterHolder
The CliktCommand is the core of command line interfaces in Clikt.
CliktError
Link copied to clipboard
common
open class CliktError(message: String?, cause: Exception?) : RuntimeException
An exception during command line processing that should be shown to the user.
Context
Link copied to clipboard
common
class Context(parent: Context?, command: CliktCommand, allowInterspersedArgs: Boolean, autoEnvvarPrefix: String?, printExtraMessages: Boolean, helpOptionNames: Set<String>, helpFormatter: HelpFormatter, tokenTransformer: Context.(String) -> String, console: CliktConsole, expandArgumentFiles: Boolean, readEnvvarBeforeValueSource: Boolean, valueSource: ValueSource?, correctionSuggestor: TypoSuggestor, localization: Localization)
A object used to control command line parsing and pass data between commands.
FileNotFound
Link copied to clipboard
common
class FileNotFound(filename: String, context: Context?) : UsageError
A required configuration file was not found.
GroupableOption
Link copied to clipboard
common
interface GroupableOption : StaticallyGroupedOption
An option that can be added to a ParameterGroup
IncorrectArgumentValueCount
Link copied to clipboard
common
class IncorrectArgumentValueCount(argument: Argument, context: Context?) : UsageError
An argument was supplied but the number of values supplied was incorrect.
IncorrectOptionValueCount
Link copied to clipboard
common
class IncorrectOptionValueCount(option: Option, givenName: String, context: Context?) : UsageError
An option was supplied but the number of values supplied to the option was incorrect.
InvalidFileFormat
Link copied to clipboard
common
class InvalidFileFormat(filename: String, message: String, lineno: Int?, context: Context?) : UsageError
A configuration file failed to parse correctly
MissingArgument
Link copied to clipboard
common
class MissingArgument(argument: Argument, context: Context?) : UsageError
A required argument was not provided
MissingOption
Link copied to clipboard
common
class MissingOption(option: Option, context: Context?) : UsageError
A required option was not provided
MutuallyExclusiveGroupException
Link copied to clipboard
common
class MutuallyExclusiveGroupException(names: List<String>, context: Context?) : UsageError
NoOpCliktCommand
Link copied to clipboard
common
open class NoOpCliktCommand(help: String, epilog: String, name: String?, invokeWithoutSubcommand: Boolean, printHelpOnEmptyArgs: Boolean, helpTags: Map<String, String>, autoCompleteEnvvar: String?, allowMultipleSubcommands: Boolean) : CliktCommand
A CliktCommand that has a default implementation of CliktCommand.run that is a no-op.
NoSuchOption
Link copied to clipboard
common
class NoSuchOption(givenName: String, possibilities: List<String>, context: Context?) : NoSuchParameter
An option was provided that does not exist.
NoSuchParameter
Link copied to clipboard
common
open class NoSuchParameter : UsageError
A parameter was provided that does not exist.
NoSuchSubcommand
Link copied to clipboard
common
class NoSuchSubcommand(givenName: String, possibilities: List<String>, context: Context?) : NoSuchParameter
A subcommand was provided that does not exist.
ParameterHolder
Link copied to clipboard
common
interface ParameterHolder
ParameterHolderDsl
Link copied to clipboard
common
annotation class ParameterHolderDsl
PrintCompletionMessage
Link copied to clipboard
common
class PrintCompletionMessage(message: String, forceUnixLineEndings: Boolean) : PrintMessage
An exception that indicates that shell completion code should be printed.
PrintHelpMessage
Link copied to clipboard
common
class PrintHelpMessage(command: CliktCommand, error: Boolean) : CliktError
An exception that indicates that the command's help should be printed.
PrintMessage
Link copied to clipboard
common
open class PrintMessage(message: String, error: Boolean) : CliktError
An exception that indicates that a message should be printed.
ProgramResult
Link copied to clipboard
common
class ProgramResult(statusCode: Int) : CliktError
Indicate that that the program finished in a controlled manner, and should complete with the given statusCode
StaticallyGroupedOption
Link copied to clipboard
common
interface StaticallyGroupedOption : Option
TypoSuggestor
Link copied to clipboard
common
typealias TypoSuggestor = (enteredValue: String, possibleValues: List<String>) -> List<String>
UsageError
Link copied to clipboard
common
open class UsageError : CliktError
An internal exception that signals a usage error.

Functions

context
Link copied to clipboard
common
fun <T : CliktCommand> T.context(block: Context.Builder.() -> Unit): T
Configure this command's Context.
findObject
Link copied to clipboard
common
inline fun <T : Any> CliktCommand.findObject(): ReadOnlyProperty<CliktCommand, T?>
Find the closest object of type T, or null
findOrSetObject
Link copied to clipboard
common
inline fun <T : Any> CliktCommand.findOrSetObject(crossinline default: () -> T): ReadOnlyProperty<CliktCommand, T>
Find the closest object of type T, setting context.obj if one is not found.
requireObject
Link copied to clipboard
common
inline fun <T : Any> CliktCommand.requireObject(): ReadOnlyProperty<CliktCommand, T>
Find the closest object of type T, or throw a NullPointerException
subcommands
Link copied to clipboard
common
fun <T : CliktCommand> T.subcommands(vararg commands: CliktCommand): T
Add the given commands as a subcommand of this command.
fun <T : CliktCommand> T.subcommands(commands: Iterable<CliktCommand>): T
Add the given commands as a subcommand of this command.