Skip to content

Improved parsing of command line argument #17

@silvanmelchior

Description

@silvanmelchior

So far, command line arguments are parsed in a very simple way, reading from sys.argv directly. This allows to deal with arbitrary white spacing and with quotes. However, an equal sign between attribute name and value (e.g. --my_config_value=3) is not supported because sys.argv does not automatically separate this.

This issue concerns both ConfZCLArgSource and ConfZFileSource.file_from_cl

So far, it is not clear how to get a more robust parsing. Libraries like argparse require to know the allowed parameters beforehand, which is not the case right now with the current architecture. It might require a complete architecture change which first analyses the config class and then reads the config sources, instead of reading the sources without knowing the config class and just passing the result to pydantic. On the other hand, such a change would also be necessary to e.g. support #12.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions