Context
class Context constructor(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, readEnvvar: (String) -> String?, originalArgv: List<String>)
Content copied to clipboard
A object used to control command line parsing and pass data between commands.
A new Context instance is created for each command each time the command line is parsed.
Constructors
Link copied to clipboard
fun 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, readEnvvar: (String) -> String? = ::readEnvvar, originalArgv: List<String> = emptyList())
Content copied to clipboard
Types
Functions
Link copied to clipboard
Return a list of command names, starting with the topmost command and ending with this Context's command.
Link copied to clipboard
Throw a UsageError with the given message
Link copied to clipboard
Find the closest object of type T
Link copied to clipboard
Link copied to clipboard
Return a list of command names, starting with the topmost command and ending with this Context's parent.
Properties
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Set this to false to prevent extra messages from being printed automatically. You can still access them at CliktCommand.messages inside of CliktCommand.run.