Skip to content

Index

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

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

Types

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>

Functions

Name Summary
argument Create a property delegate argument.funCliktCommand.argument(name:String= "", help:String= "", helpTags:Map<String,String> = emptyMap(), completionCandidates:CompletionCandidates? = null): RawArgument
convert Convert the argument’s values.fun <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 error.fun <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 error.fun <T :Any>ProcessedArgument<T, T>.defaultLazy(value: () -> T):ArgumentDelegate<T>
multiple Accept any number of values to this argument.fun <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 given.fun <AllT :Any, ValueT>ProcessedArgument<AllT, ValueT>.optional():ProcessedArgument<AllT?, ValueT>
pair Require exactly two values to this argument, and store them in a Pair.fun <T :Any>ProcessedArgument<T, T>.pair():ProcessedArgument<Pair<T, T>, T>
transformAll Transform all values to the final argument type.fun <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 valid.fun <AllT :Any, ValueT>ProcessedArgument<AllT, ValueT>.validate(validator:ArgValidator<AllT>):ArgumentDelegate<AllT>
wrapValue fun RawArgument.~~wrapValue~~(wrapper: (String) ->Any): RawArgument
Wrap the argument’s values after a conversion is applied.fun <T1 :Any, T2 :Any>ProcessedArgument<T1, T1>.~~wrapValue~~(wrapper: (T1) -> T2):ProcessedArgument<T2, T2>