use std::io::Write;
use clap::{Args, ValueEnum};
#[derive(Debug, Args)]
pub(crate) struct SchemaArgs {
#[arg(value_enum, env = "FLUSSO_SCHEMA")]
which: SchemaKind,
}
#[derive(Debug, Clone, Copy, ValueEnum)]
enum SchemaKind {
Config,
Index,
}
pub(crate) fn execute(args: SchemaArgs) -> anyhow::Result<()> {
let body = match args.which {
SchemaKind::Config => schema::CONFIG_SCHEMA,
SchemaKind::Index => schema::INDEX_SCHEMA,
};
let mut out = std::io::stdout().lock();
writeln!(out, "{}", body.trim_end())?;
Ok(())
}