Open Pa3u3u opened 1 year ago
I have added a generic args parser, which can be used similarly to getopts.
I also changed the formats, each format now parses its options itself. New format can now be added via a generic module, which associates a format class with a format name and instantiates new format instances.
These are just general observations I made when reading your code. You are not required to fix any of these but may give you some suggestions on what to improve.
The argument parsing could be more generic; for example, you could have tried to imitate Getopt's functionality by providing a description of the options in a declarative way. Currently, option parsing has hard-wired code paths that split over
=
manually, leading to slight code duplication.Format options could be handled more generically as well. Currently, to add a new format, one must implement the classes, but also change the argument parser. Perhaps the format could be implemented as a stand-alone module (with an interface) that could tell the parser what it wants.
Good job with setting up tests to unify Unit tests and Integration tests without using Python, Shell or other scripting languages.