use clap::ValueEnum;
use std::fmt;
#[derive(Debug, Clone, Copy, ValueEnum, PartialEq, Eq)]
pub enum LogFormat {
Plain,
Json,
}
impl fmt::Display for LogFormat {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
match self {
LogFormat::Plain => write!(f, "plain"),
LogFormat::Json => write!(f, "json"),
}
}
}
#[derive(Debug, Clone, Copy, ValueEnum, PartialEq, Eq)]
pub enum OutputFormat {
Normal,
Wide,
}
impl fmt::Display for OutputFormat {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
match self {
OutputFormat::Normal => write!(f, "normal"),
OutputFormat::Wide => write!(f, "wide"),
}
}
}
impl OutputFormat {
pub fn includes_registry(&self) -> bool {
matches!(self, OutputFormat::Wide)
}
pub fn includes_digest(&self) -> bool {
matches!(self, OutputFormat::Wide)
}
pub fn includes_node(&self) -> bool {
matches!(self, OutputFormat::Wide)
}
}