from
fun from(file: Path, requireValid: Boolean = false, getKey: (Context, Option) -> String = ValueSource.getKey(joinSubcommands = ".")): ValueSource
fun from(file: File, requireValid: Boolean = false, getKey: (Context, Option) -> String = ValueSource.getKey(joinSubcommands = ".")): ValueSource
fun from(file: String, requireValid: Boolean = false, getKey: (Context, Option) -> String = ValueSource.getKey(joinSubcommands = ".")): ValueSource
Parse a properties file into a value source.
If the file does not exist, an empty value source will be returned.
Parameters
file
The file to read from.
require Valid
If true, a InvalidFileFormat will be thrown if the file doesn't parse correctly.
get Key
A function that will return the property key for a given option. You can use ValueSource.getKey for most use cases.
fun from(properties: Properties, getKey: (Context, Option) -> String = ValueSource.getKey(joinSubcommands = ".")): ValueSource
Return a ValueSource that reads values from a properties object.
The properties object is copied when this function is called; changes to the object will not be reflected in the value source.
Parameters
properties
The properties to read from.
get Key
A function that will return the property key for a given option.