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 key, value pairs without a section? #44

Open
kvrohit opened this issue Jun 14, 2022 · 3 comments
Open

Support for key, value pairs without a section? #44

kvrohit opened this issue Jun 14, 2022 · 3 comments

Comments

@kvrohit
Copy link

kvrohit commented Jun 14, 2022

As described in this wiki article: https://en.wikipedia.org/wiki/INI_file#Sections

Keys may, but need not, be grouped into arbitrarily named sections

I want to create an ini file that resembles something like this:

authorityKeyIdentifier=keyid,issuer
basicConstraints=CA:FALSE
keyUsage = digitalSignature, nonRepudiation, keyEncipherment, dataEncipherment
subjectAltName = @alt_names

[alt_names]
DNS.1 = *.github.com

Notice that the first set of key, value pairs do not belong to any section.

Using tini for creating this type of ini results in the following:

[]
authorityKeyIdentifier = keyid,issuer
basicConstraints = CA:FALSE
keyUsage = digitalSignature, nonRepudiation, keyEncipherment, dataEncipherment
subjectAltName = @alt_names

[alt_names]
DNS.1 = *.github.com

Is there a way to tell it to not create the empty [] section?

@FreeCX
Copy link
Member

FreeCX commented Jun 14, 2022

This feature is not supported.

Unfortunately, there is no time to update the API or implement 2.0

But you may add check for empty section here.

@kvrohit
Copy link
Author

kvrohit commented Jun 14, 2022

Ah, I see. Thanks for your quick response and for creating this crate. The API is intuitive and the docs are pretty good when compared to similar libraries. I hope you get some time to work on 2.0.

@FreeCX
Copy link
Member

FreeCX commented Jun 14, 2022

Thank you!

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

2 participants