JuliaIO / ConfParser.jl

Julia package for parsing configuration files
Other
44 stars 17 forks source link

Case of INI sections is ignored #23

Open dburov190 opened 5 years ago

dburov190 commented 5 years ago

If an INI file has a section named [General], then calling var = retrieve(conf, "General", "var") will cause an exception (since the dictionary field of conf will have "general" as one of the keys).

It would be nice to have case-sensitive sections, but at the very least it shouldn't spit out an error, i.e. it should convert everything to lower case, for example, before trying to find a key in the internal dictionary.

jonathanBieler commented 5 years ago

The section names seems to be lowercased yes:

https://github.com/JuliaIO/ConfParser.jl/blob/master/src/ConfParser.jl#L109

It would probably make sense to lowercase the key when retrieving.

dburov190 commented 5 years ago

Either that or, maybe, just leave it as it is? i.e. substitute the linked line with blockname = m.captures[1] I think it would be more standard behavior? Python's configparser does that.