libelektra
libelektra copied to clipboard
Feature proposal: Output error/warning if a key that isn't in spec-file is set
Notes
- I'd like to fix this as part of my thesis.
- Is this a sensible improvement or is there a reason for the current behavior?
- I've searched through the existing issues but found no mention of this.
- This could be implemented as an optional feature that is disabled by default.
Current behavior
- Create file
test.iniwith content:
[]
mountpoint = test.ecf
[mykeyfromspec]
type = boolean
check/type = boolean
sudo kdb mount -v `pwd`/test.ini spec:/tests/test nisudo kdb spec-mount /tests/kdb set /tests/test/mykeyfromspec truekdb set /tests/test/somekeynotinspec somevaluekdb set /tests/test/subtree/somekeynotinspec somevalue
Proposed behavior
- Steps 1 to 4. as above
- Step 5 and 6 output an error/warning, that a key was set, that is not part of the specification file (or that has no spec-related metadata).
Motivation
- If one purpose of spec files is describing what configuration options a software does (not) support, this would make sense.
- During my work on Elektrifying redshift I often used
kdb seton some keys that weren't part of the spec and wondered why I didn't receive a warning that they validate acheck/rule (e.g. when I accidentally spelt the keyname wrong in mykdb setcall).
@markus2330 What do you think about this?
Do structs solve the issue you describe here?
Thanks @markus2330 for your input. I will get back to you after my work on other issues.
I mark this issue stale as it did not have any activity for one year. I'll close it in two weeks if no further activity occurs. If you want it to be alive again, ping the issue by writing a message here or create a new issue with the remainder of this issue. Thank you for your contributions :sparkling_heart:
I closed this issue now because it has been inactive for more than one year. If I closed it by mistake, please do not hesitate to reopen it or create a new issue with the remainder of this issue. Thank you for your contributions :sparkling_heart:
This conflicts with #3938