use clap::ValueEnum;
#[derive(Clone, Copy, Debug, Default, PartialEq, ValueEnum)]
pub enum Output {
Json,
#[default]
Text,
Table,
Yaml,
YamlStream,
}
impl Output {
pub fn output(&self, object: Box<dyn show::Show>) -> String {
match self {
Self::Json => object.json(),
Self::Text => object.text(),
Self::Table => object.table(),
Self::Yaml => object.yaml(),
Self::YamlStream => object.yaml_stream(),
}
}
}