2021-09-10 01:42:49 +00:00
|
|
|
use crate::cli_options::{Mode, Opt};
|
|
|
|
use crate::execute::execute_report_main;
|
|
|
|
use crate::scan::scan_main;
|
2020-08-05 21:43:57 +00:00
|
|
|
use clap::Clap;
|
2019-10-11 14:19:18 +00:00
|
|
|
|
2021-09-10 01:42:49 +00:00
|
|
|
mod cli_options;
|
|
|
|
mod execute;
|
|
|
|
mod file_results;
|
|
|
|
mod logging;
|
|
|
|
mod scan;
|
|
|
|
mod ser_bridge;
|
2021-09-09 04:37:36 +00:00
|
|
|
|
2021-09-08 23:21:20 +00:00
|
|
|
fn main() -> Result<(), std::io::Error> {
|
|
|
|
let opt = Opt::parse();
|
|
|
|
|
|
|
|
match opt.mode {
|
2021-09-09 04:37:36 +00:00
|
|
|
Mode::Scan(scan_opt) => scan_main(scan_opt),
|
|
|
|
Mode::ExecuteReport(exeute_report_opt) => {
|
|
|
|
if execute_report_main(exeute_report_opt).is_err() {
|
|
|
|
// Do nothing.
|
|
|
|
}
|
|
|
|
|
|
|
|
// Do NOT report errors in this function so it doesn't pollute the
|
|
|
|
// CSV output.
|
|
|
|
Ok(())
|
|
|
|
}
|
2021-09-08 23:21:20 +00:00
|
|
|
}
|
|
|
|
}
|