Skip to content


clikt / com.github.ajalt.clikt.parameters.arguments

Package com.github.ajalt.clikt.parameters.arguments


Name Summary
ArgCallsTransformer A callback that transforms all the values into the final argument typetypealias ArgCallsTransformer<AllT, EachT> =ArgumentTransformContext.(List<EachT>) -> AllT
Argument A positional parameter to a command.interface Argument
ArgumentDelegate An argument that functions as a property delegateinterface ArgumentDelegate<out T> :Argument,ReadOnlyProperty<CliktCommand, T>
ArgumentTransformContext A receiver for argument transformers.class ArgumentTransformContext :Argument
ArgValidator A callback validates the final argument typetypealias ArgValidator<AllT> =ArgumentTransformContext.(AllT) ->Unit
ArgValueConverter A callback that transforms a single value from one type to anothertypealias ArgValueConverter<InT, ValueT> =ArgumentTransformContext.(InT) -> ValueT
ArgValueTransformer A callback that transforms a single value from a string to the value typetypealias ArgValueTransformer<T> =ArgValueConverter<String, T>
ProcessedArgument An Argument delegate implementation that transforms its values .class ProcessedArgument<AllT, ValueT> :ArgumentDelegate<AllT>
RawArgument typealias RawArgument =ProcessedArgument<String,String>


Name Summary
argument Create a property delegate argument.funCliktCommand.argument(name:String= "", help:String= "", helpTags:Map<String,String> = emptyMap(), completionCandidates:CompletionCandidates? = null):RawArgument
check Check the final argument value and raise an error if it’s not <AllT :Any, ValueT>ProcessedArgument<AllT, ValueT>.check(message:String, validator: (AllT) ->Boolean):ArgumentDelegate<AllT>
fun <AllT :Any, ValueT>ProcessedArgument<AllT, ValueT>.check(lazyMessage: (AllT) ->String= { it.toString() }, validator: (AllT) ->Boolean):ArgumentDelegate<AllT>
convert Convert the argument’s <InT :Any, ValueT :Any>ProcessedArgument<InT, InT>.convert(completionCandidates:CompletionCandidates= completionCandidatesWithDefault.default, conversion:ArgValueConverter<InT, ValueT>):ProcessedArgument<ValueT, ValueT>
default If the argument is not given, use value instead of throwing an <T :Any>ProcessedArgument<T, T>.default(value: T):ArgumentDelegate<T>
defaultLazy If the argument is not given, call value and use its return value instead of throwing an <T :Any>ProcessedArgument<T, T>.defaultLazy(value: () -> T):ArgumentDelegate<T>
help Set the help for this <AllT, ValueT>ProcessedArgument<AllT, ValueT>.help(help:String):ProcessedArgument<AllT, ValueT>
multiple Accept any number of values to this <T :Any>ProcessedArgument<T, T>.multiple(required:Boolean= false):ProcessedArgument<List<T>, T>
optional Return null instead of throwing an error if no value is <AllT :Any, ValueT>ProcessedArgument<AllT, ValueT>.optional():ProcessedArgument<AllT?, ValueT>
pair Require exactly two values to this argument, and store them in a <T :Any>ProcessedArgument<T, T>.pair():ProcessedArgument<Pair<T, T>, T>
transformAll Transform all values to the final argument <AllInT, ValueT, AllOutT>ProcessedArgument<AllInT, ValueT>.transformAll(nvalues:Int? = null, required:Boolean? = null, transform:ArgCallsTransformer<AllOutT, ValueT>):ProcessedArgument<AllOutT, ValueT>
triple Require exactly three values to this argument, and store them in a Triplefun <T :Any>ProcessedArgument<T, T>.triple():ProcessedArgument<Triple<T, T, T>, T>
unique Only store unique values for this argumentfun <T :Any>ProcessedArgument<List<T>, T>.unique():ProcessedArgument<Set<T>, T>
validate Check the final argument value and raise an error if it’s not <AllT :Any, ValueT>ProcessedArgument<AllT, ValueT>.validate(validator:ArgValidator<AllT>):ArgumentDelegate<AllT>