codelens_core/output/
mod.rs1mod console;
4mod csv;
5mod format;
6mod html;
7mod json;
8mod markdown;
9
10pub use console::ConsoleOutput;
11pub use csv::CsvOutput;
12pub use format::{OutputFormat, OutputOptions};
13pub use html::HtmlOutput;
14pub use json::JsonOutput;
15pub use markdown::MarkdownOutput;
16
17use crate::config::OutputFormatType;
18
19pub fn create_output(format: OutputFormatType) -> Box<dyn OutputFormat> {
21 match format {
22 OutputFormatType::Console => Box::new(ConsoleOutput::new()),
23 OutputFormatType::Json => Box::new(JsonOutput::new(true)),
24 OutputFormatType::Csv => Box::new(CsvOutput::new()),
25 OutputFormatType::Markdown => Box::new(MarkdownOutput::new()),
26 OutputFormatType::Html => Box::new(HtmlOutput::new()),
27 }
28}