Kotlin / kotlinx-cli

Pure Kotlin implementation of a generic CLI parser.
Apache License 2.0
914 stars 71 forks source link

Fix `ArgType.Boolean::convert` function #100

Closed Stoorx closed 11 months ago

Stoorx commented 1 year ago

Since anything which is not exactly "false" was considered to be true, it could lead to errors in program behaviour for end users. For example, "0", "no", "hello", and (ridiculously) "False" were parsed as true.

This commit changes the function behaviour to case-insensitively parse "true" as true, "false" as false, and throw ParsingException for anything else.