Skip to content

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

path

fun RawArgument.path(mustExist: Boolean = false, canBeFile: Boolean = true, canBeDir: Boolean = true, mustBeWritable: Boolean = false, mustBeReadable: Boolean = false, canBeSymlink: Boolean = true, fileSystem: FileSystem = FileSystems.getDefault()): ProcessedArgument

Convert the argument to a Path.

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

fileSystem - The FileSystem with which to resolve paths

canBeSymlink - If false, fail if the given path is a symlinkfun RawOption.path(mustExist: Boolean = false, canBeFile: Boolean = true, canBeDir: Boolean = true, mustBeWritable: Boolean = false, mustBeReadable: Boolean = false, canBeSymlink: Boolean = true, fileSystem: FileSystem = FileSystems.getDefault()): NullableOption

Convert the option to a Path.

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

fileSystem - The FileSystem with which to resolve paths.

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