pub mod json;
pub mod terminal;
use crate::report::Report;
#[derive(Debug, Clone)]
pub struct OutputConfig {
pub json: bool,
pub quiet: bool,
pub verbose: bool,
pub color: bool,
}
impl Default for OutputConfig {
fn default() -> Self {
OutputConfig {
json: false,
quiet: false,
verbose: false,
color: true,
}
}
}
pub fn render(report: &Report, cfg: &OutputConfig) -> anyhow::Result<()> {
if cfg.json {
json::print(report)
} else {
terminal::print(report, cfg)
}
}