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

Extend array declaration capabilities (with possible breaking change) #11

Open
Krakean opened this issue Jun 3, 2019 · 3 comments
Open
Assignees

Comments

@Krakean
Copy link

Krakean commented Jun 3, 2019

Currently, arrays can be declared only this way:
arrayWorkToo =
arrayElement1
arrayElement2

My suggestion is possibly remove such way of defining them (may be to make parsing a bit more strict), and instead allow these:
arrayWorkToo = [ 1, 2, 3 ]
arrayWorkToo = [ “red”, “yellow”, “black” ]
arrayWorkToo = [ [ 1, 2 ], [3, 4, 5] ]
arrayWorkToo = [
arrayElement1,
arrayElement2
]
arrayWorkToo = [ { x = 1, y = 2, z = 3 },
{ x = 4, y = 5, z = 6} ]

@salaros salaros self-assigned this Jun 7, 2019
@salaros
Copy link
Owner

salaros commented Jun 7, 2019

Defacto there are few standards for reading/writing arrays in .ini/.conf files.
I've simply implemented the one I've seen in Python applications I had to share config files with.

Examples:
https://wakatime.com/faq#exclude-paths
https://stackoverflow.com/questions/4097139/reading-array-from-config-file-in-python/47891483#answer-11296626

So I cannot accept your request to drop the support of this format, I think I will implement some sort of setting for array format instead.

@TomArrow
Copy link

I have a related request so I'm just putting this in here instead of making a new issue.

Could you make it possible to read duplicate keys?

Like

[mySection]
value=abc
value=def

So that I can get an array containing "abc" and "def"? Just being able to read it would be good enough for starters I think.

I guess I can manage for now with a loop but it would be nice to have.

@salaros
Copy link
Owner

salaros commented Aug 20, 2021

@TomArrow makes sense

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

No branches or pull requests

3 participants