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}
11
12/// Determine the kind of report to generate based on the current shell.
13pub fn report_kind() -> ReportKind {
14 if shell::is_json() {
15 ReportKind::JSON
16 } else {
17 ReportKind::Text
18 }
19}