Draft: Add an extensible CLI which can be modified by JSON
This is an attempt to address #136 (closed).
The idea is to have a unified way to configure jobs that supports both CLI and JSON. This avoids each script implementing custom configuration logic
I have added a standalone cli.py
would replace the CLI in dumper.py
and supports combined CLI and JSON configuration (where CLI takes precedence). This works by setting the ArgumentParser
defaults based on the contents of the JSON file. Rudimentary type checking is included here (not included for nested config).
See cli_test.json
as an example of how to set arguments via config files.
The CLI is extensible as shown in the modified dump-retag-lite
script.
Questions
do we want to have nested arguments? for the retag example, instead of
"args": {
"max_events": 50,
"ip_method": "poor"
}
we would have
"args": {
"dumper": {
"max_events": 50
},
"retag": {
"ip_method": "poor"
}
}
The nice thing about the latter is that it could lead to pretty modular ca scripts being define which have the ability to include one another