use clap::Args;
#[derive(Debug, Args)]
pub(super) struct OutputArgs {
#[arg(long, value_delimiter = ',', conflicts_with = "json")]
fields: Option<Vec<String>>,
#[arg(long)]
json: bool,
}
impl OutputArgs {
pub(super) fn mode(&self) -> Output<'_> {
if self.json {
Output::Json
} else if let Some(paths) = self.fields.as_deref() {
Output::Tsv(paths)
} else {
Output::Pretty
}
}
}
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub(super) enum Output<'a> {
Pretty,
Tsv(&'a [String]),
Json,
}