status-im / nim-confutils

Simplified handling of command line options and config files
Apache License 2.0
64 stars 16 forks source link

Add custom Enum parser proc to keep Nim 1.2 behaviour #63

Closed kdeme closed 1 year ago

kdeme commented 1 year ago

In Nim 1.6 parseEnum normalizes the string except for the first character. Nim 1.2 would normalize for all characters. In config options the latter behaviour is required so this custom function is needed.

In case the Nim version conditions are too much disliked, we could also just copy paste the simple 1.2 code: https://github.com/nim-lang/Nim/blob/v1.2.18/lib/pure/strutils.nim#L1253

kdeme commented 1 year ago

Going to merge this as the failures on 1.6 and devel seem something new and unrelated a this dummy PR also fails: https://github.com/status-im/nim-confutils/pull/64