use crate::prelude::*;
use caesura_macros::Options;
use serde::{Deserialize, Serialize};
#[derive(Options, Clone, Debug, Deserialize, Serialize)]
pub struct SourceArg {
#[arg(value_name = "SOURCE")]
pub source: String,
}
impl OptionsContract for SourceArg {
type Partial = SourceArgPartial;
fn validate(&self, _errors: &mut Vec<OptionRule>) {}
}
impl Display for SourceArg {
fn fmt(&self, formatter: &mut Formatter<'_>) -> FmtResult {
let output = if let Ok(yaml) = serde_yaml::to_string(self) {
yaml
} else {
format!("{self:?}")
};
write!(formatter, "{output}")
}
}