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

file

fun RawArgument.file(): ProcessedArgument<File, File> fun RawArgument.file(mustExist: Boolean = false, canBeFile: Boolean = true, canBeDir: Boolean = true, mustBeWritable: Boolean = false, mustBeReadable: Boolean = false, canBeSymlink: Boolean = true): ProcessedArgument<File, File>

Convert the argument to a File.

Parameters

mustExist - If true, fail if the given path does not exist

canBeFile - If false, fail if the given path is a file

canBeDir - If false, fail if the given path is a directory

mustBeWritable - If true, fail if the given path is not writable

mustBeReadable - If true, fail if the given path is not readable

canBeSymlink - If false, fail if the given path is a symlinkfun RawArgument.~~file~~(exists: Boolean = false, fileOkay: Boolean = true, folderOkay: Boolean = true, writable: Boolean = false, readable: Boolean = false): ProcessedArgument<File, File> Deprecated: Parameters have been renamed. All arguments must be called by name to remove this warning.

fun RawOption.~~file~~(exists: Boolean = false, fileOkay: Boolean = true, folderOkay: Boolean = true, writable: Boolean = false, readable: Boolean = false): NullableOption<File, File> Deprecated: Parameters have been renamed. All arguments must be called by name to remove this warning.

fun RawOption.file(): NullableOption<File, File>

Convert the option to a File.

Parameters

mustExist - If true, fail if the given path does not exist

canBeFile - If false, fail if the given path is a file

canBeDir - If false, fail if the given path is a directory

mustBeWritable - If true, fail if the given path is not writable

mustBeReadable - If true, fail if the given path is not readablefun RawOption.file(mustExist: Boolean = false, canBeFile: Boolean = true, canBeDir: Boolean = true, mustBeWritable: Boolean = false, mustBeReadable: Boolean = false, canBeSymlink: Boolean = true): NullableOption<File, File>

Convert the option to a File.

Parameters

mustExist - If true, fail if the given path does not exist

canBeFile - If false, fail if the given path is a file

canBeDir - If false, fail if the given path is a directory

mustBeWritable - If true, fail if the given path is not writable

mustBeReadable - If true, fail if the given path is not readable

canBeSymlink - If false, fail if the given path is a symlink