diff --git a/clikt/src/jvmMain/kotlin/com/github/ajalt/clikt/sources/PropertiesValueSource.kt b/clikt/src/jvmMain/kotlin/com/github/ajalt/clikt/sources/PropertiesValueSource.kt index e599b1dbd..942403661 100644 --- a/clikt/src/jvmMain/kotlin/com/github/ajalt/clikt/sources/PropertiesValueSource.kt +++ b/clikt/src/jvmMain/kotlin/com/github/ajalt/clikt/sources/PropertiesValueSource.kt @@ -57,19 +57,7 @@ object PropertiesValueSource { requireValid: Boolean = false, getKey: (Context, Option) -> String = ValueSource.getKey(joinSubcommands = "."), ): ValueSource { - val properties = Properties() - if (file.isFile) { - try { - file.bufferedReader().use { properties.load(it) } - } catch (e: Throwable) { - if (requireValid) throw InvalidFileFormat( - file.name, - e.message ?: "could not read file" - ) - } - } - - return from(properties, getKey) + return from(file.toPath(), requireValid, getKey) } /**