Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for "[[section]]" #48

Open
JimboJoe opened this issue Feb 12, 2017 · 2 comments
Open

Support for "[[section]]" #48

JimboJoe opened this issue Feb 12, 2017 · 2 comments

Comments

@JimboJoe
Copy link

JimboJoe commented Feb 12, 2017

Configuration files use sometimes sections with double brackets (e.g. [[graphite]] in influxdb.conf or [[servers]] in ldap.toml for Grafana), but this syntax seems to be actually unsupported.
Would it be possible to support that?
Thanks!

@pixelb
Copy link
Owner

pixelb commented Feb 15, 2017

Right, we explicitly disallow that since commit 50718ed,
as without that commit we could read and write existing section contents containing extra [ ... ]
but we can't write new sections or get section names with [ ... ] so that would be inconsistent.

Extra [ ... ] are also used (with reason) in http://editorconfig.org/#file-format-details

Also I think the php ini parsers supports this format.

Now it's a bit of a gotcha that people might specify the '[section]' with brackets with --set,
which might create extraneous sections, so maybe we should support this with an option.
Options are best avoided of course, so we might just support unconditionally

@tobixx
Copy link

tobixx commented Feb 9, 2018

I want to express also my interest in this issue.
I'm not sure if my use case is identical with the original reporter because for me the double brackets means subsections. Usually we parse/write it with configobj where this is directly supported. For the cli interface my idea would be that any arg but the last one should be interpreted as (sub-)sections traversing the hierarchy.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants