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

removing unnecessary restrictions in recognizing the configuration data #4

Open
mycoboco opened this Issue Dec 12, 2013 · 0 comments

Comments

Projects
None yet
1 participant
@mycoboco
Owner

mycoboco commented Dec 12, 2013

With the current version of cel/conf, its users are forced to choose one of two alternative modes:

  • set the configuration data that a program can recognize and reject any other sections and variables (they are treated as an error); or
  • make a program recognize an open-ended set of sections and variables (there is no error occurred provided that sections and variables are well-formed)

These options are not enough when a user wants to preset the configuration data but still wants to allow other sections and variables accepted. In addtion to it, a user (not the library) might want to check if a given section or variable should be accepted; for example, consider a configuration file where a variable specifies what forms of sections should be accepted:

no_of_section = 2

[section_1]    # accepted
...

[section_2]    # accepted
...

[section_3]    # rejected

To support this it should be possible for a user to register a callback function that is invoked whenever a non-preset section or variable is encountered.

@ghost ghost assigned mycoboco Dec 12, 2013

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