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 top-level comment #63

Open
Tsudico opened this issue May 16, 2019 · 0 comments
Open

Support top-level comment #63

Tsudico opened this issue May 16, 2019 · 0 comments

Comments

@Tsudico
Copy link

Tsudico commented May 16, 2019

I am trying to write a header comment that appears before any of my config options. When I try to use a empty path in setComment, it doesn't add the comment at all. It appears that currently I have to prepend the comment to the first entry.

Current use:

config.setComment("version", " Test Configuration\n To reset any value to it's default, remove the value from this file"
    + " The version of the test bench");

Proposed use:

// No path means this is the file's header comment
config.setComment(" Test Configuration\n To reset any value to it's default, remove the value from this file");

// Alternate proposal: use an empty path ""
config.setComment("", " Test Configuration\n To reset any value to it's default, remove the value from this file");

// Normal comment
config.setComment("version", " The version of the test bench");

example.toml

# Test Configuration
# To reset any value to it's default, remove the value from this file

# The version of the test bench
version="1.0.6"

[Debug]
verbose=true
test="complete"
@TheElectronWill TheElectronWill self-assigned this May 19, 2019
@TheElectronWill TheElectronWill changed the title File level comment Support top-level comment May 19, 2019
@TheElectronWill TheElectronWill added this to the NightConfig v4 milestone Dec 7, 2019
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

2 participants