foundry_common/
reports.rs

1use serde::{Deserialize, Serialize};
2
3use crate::shell;
4
5#[derive(Default, Clone, Debug, Serialize, Deserialize, PartialEq, Eq)]
6pub enum ReportKind {
7    #[default]
8    Text,
9    JSON,
10    Markdown,
11}
12
13/// Determine the kind of report to generate based on the current shell.
14pub fn report_kind() -> ReportKind {
15    if shell::is_json() {
16        ReportKind::JSON
17    } else if shell::is_markdown() {
18        ReportKind::Markdown
19    } else {
20        ReportKind::Text
21    }
22}