Add ScanOpts and cleanup Scan CLI
What
This MR adds a new structure ScanOpts
to hold (in principle) the items that define the state (and control flow) of a given scan. The CLI is updated to add dedicated user input parsing to then fill out a ScanOpts
structure which is then passed to the ScanConsole
object.
As a result, the ScanConsole
class no longer provides a CLI. Generally, the CLI should be entirely removed from underlying classes and extracted. The classes (scans) should be configurable/runnable independent of their environment (from the command line or otherwise).
Thought 1
In principle we could replace the ScanOpts
struct with just a JSON object and then enforce a schema. We can then easily version the schema such that what defines a scan (at minimum) can then also be versioned and tracked.
Thought 2
Functions like ScanConsole::loadConfig
can also be made to take std::variant<ScanOpts, json, ...>
such that however the overall scan configuration is provided (user input vs json object vs whatever) the function can be made to react properly.