Skip to content

Home

clikt / com.github.ajalt.clikt.parameters.types

Package com.github.ajalt.clikt.parameters.types

Functions

Name Summary
choice fun <T :Any> RawArgument.choice(choices:Map<String,T>):ProcessedArgument<T,T>
fun <T :Any> RawArgument.choice(vararg choices:Pair<String,T>):ProcessedArgument<T,T>
Convert the argument based on a fixed set of values.fun RawArgument.choice(vararg choices:String):ProcessedArgument<String,String>
Restrict the argument to a fixed set of values.fun <T :Any>RawOption.choice(choices:Map<String,T>, metavar:String= mvar(choices.keys)):NullableOption<T,T>
fun <T :Any>RawOption.choice(vararg choices:Pair<String,T>, metavar:String= mvar(choices.map { it.first })):NullableOption<T,T>
Convert the option based on a fixed set of values.funRawOption.choice(vararg choices:String, metavar:String= mvar(choices.asIterable())):NullableOption<String,String>
Restrict the option to a fixed set of values.
double fun RawArgument.double():ProcessedArgument<Double,Double>
Convert the argument values to a Double``funRawOption.double():NullableOption<Double,Double>
Convert the option values to a Double
enum fun <T :Enum<T>> RawArgument.enum(key: (T) ->String= { it.name }):ProcessedArgument<T,T>
Convert the argument to the values of an enum.fun <T :Enum<T>>RawOption.enum(key: (T) ->String= { it.name }):NullableOption<T,T>
Convert the option to the values of an enum.
file fun RawArgument.file(exists:Boolean= false, fileOkay:Boolean= true, folderOkay:Boolean= true, writable:Boolean= false, readable:Boolean= false):ProcessedArgument<File,File>
Convert the argument to a File.funRawOption.file(exists:Boolean= false, fileOkay:Boolean= true, folderOkay:Boolean= true, writable:Boolean= false, readable:Boolean= false):NullableOption<File,File>
Convert the option to a File.
float fun RawArgument.float():ProcessedArgument<Float,Float>
Convert the argument values to a Float``funRawOption.float():NullableOption<Float,Float>
Convert the option values to a Float
int fun RawArgument.int():ProcessedArgument<Int,Int>
Convert the argument values to an Int``funRawOption.int():NullableOption<Int,Int>
Convert the option values to an Int
long fun RawArgument.long():ProcessedArgument<Long,Long>
Convert the argument values to a Long``funRawOption.long():NullableOption<Long,Long>
Convert the option values to a Long
path fun RawArgument.path(exists:Boolean= false, fileOkay:Boolean= true, folderOkay:Boolean= true, writable:Boolean= false, readable:Boolean= false, fileSystem: FileSystem = FileSystems.getDefault()):ProcessedArgument<Path, Path>
Convert the argument to a Path.funRawOption.path(exists:Boolean= false, fileOkay:Boolean= true, folderOkay:Boolean= true, writable:Boolean= false, readable:Boolean= false, fileSystem: FileSystem = FileSystems.getDefault()):NullableOption<Path, Path>
Convert the option to a Path.
restrictTo fun <T>ProcessedArgument<T,T>.restrictTo(min:T? = null, max:T? = null, clamp:Boolean= false):ProcessedArgument<T,T> where T :Number, T :Comparable<T>
fun <T>ProcessedArgument<T,T>.restrictTo(range:ClosedRange<T>, clamp:Boolean= false):ProcessedArgument<T,T> where T :Number, T :Comparable<T>
Restrict the argument values to fit into a range.fun <T>OptionWithValues<T?,T,T>.restrictTo(min:T? = null, max:T? = null, clamp:Boolean= false):OptionWithValues<T?,T,T> where T :Number, T :Comparable<T>
fun <T>OptionWithValues<T?,T,T>.restrictTo(range:ClosedRange<T>, clamp:Boolean= false):OptionWithValues<T?,T,T> where T :Number, T :Comparable<T>
Restrict the option values to fit into a range.