use std::path::PathBuf;
use anyhow::Result;
use bpaf::Bpaf;
#[derive(Debug, Clone, Bpaf)]
pub struct GenerateArgs {
#[bpaf(
long("config"),
argument("PATH"),
fallback(PathBuf::from("lintel-catalog.toml"))
)]
pub config: PathBuf,
#[bpaf(long("target"), argument("NAME"))]
pub target: Option<String>,
#[bpaf(long("concurrency"), argument("N"), fallback(20))]
pub concurrency: usize,
#[bpaf(long("no-cache"), switch)]
pub no_cache: bool,
}
impl GenerateArgs {
pub async fn run(self) -> Result<()> {
crate::generate::run(
&self.config,
self.target.as_deref(),
self.concurrency,
self.no_cache,
)
.await
}
}