Skip to content

removing unnecessary restrictions in recognizing the configuration data #4

Description

@mycoboco

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.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions