basho / cuttlefish

never lose your childlike sense of wonder baby cuttlefish, promise me?
Apache License 2.0
205 stars 124 forks source link

Support for sections in .conf [JIRA: RIAK-3054] #227

Open joshuabach opened 7 years ago

joshuabach commented 7 years ago

It might be useful to expand the config file parser to support unix-conf-style sections, e.g.:

[foo.bar]
a = 3
b = test

instead of

foo.bar.a = 3
foo.bar.b = test

The semantics could be really simple: Every key $key found in section [$section] is prefixed with $section, resulting in $section.$key.

This would help to avoid redundancy in the .conf files.

angrycub commented 7 years ago

One of the driving factors for using sysctl-style names as opposed to INI-style groupings allow for any value to be single lined and placed at any point in the file. This, coupled with the last-read wins scheme, allows you to compose configurations very easily by concatenating files from most general to most specific. This form is easily usable from line-based commands like grep.

joshuabach commented 7 years ago

Well, since it could simply be an additional parsing method, this would not be a problem. If (as an admin) I want to be able to use sed, grep and family to manage my configuration files, I can stick to the sysctl syntax, if that is not as important to me, I can use sections. The default generated config might still be syctl-like.

joshuabach commented 7 years ago

Maybe this can be closed in favor of #207