aibasel / machetli

GNU General Public License v3.0
6 stars 3 forks source link

Remove cmd_name from the Parser's add_pattern method and add parser argument to the Run's constructor #9

Closed galerykaeser closed 2 years ago

galerykaeser commented 3 years ago

Currently, the add_pattern method of the parser class has an argument cmd_names, which accepts one or multiple run object names (as, e.g., defined and used here). Storing the names of the runs inside a parser object creates an unnecessary coupling between a parser and the run(s). The parser does not need to know anything about the run(s) it should be used for.

Improvement suggestion: Remove the cmd_names argument from add_pattern and add a parsers argument to the constructor of the run class. This way, each run has an internal list containing the parser(s) to be applied to its output.

FlorianPommerening commented 2 years ago

We now decoupled parsing the output from running the code, so this is no longer applicable.