use clap::{Args, Subcommand};
use crate::cli::commands::output::OutputArgs;
use super::github::GitHubOutputFormat;
#[derive(Args, Debug)]
pub struct HuggingFaceArgs {
#[command(subcommand)]
pub command: HuggingFaceCommand,
}
#[derive(Subcommand, Debug)]
pub enum HuggingFaceCommand {
#[command(subcommand)]
Repos(HuggingFaceReposCommand),
}
#[derive(Subcommand, Debug)]
pub enum HuggingFaceReposCommand {
List(HuggingFaceReposListArgs),
}
#[derive(Args, Debug, Clone)]
pub struct HuggingFaceReposListArgs {
#[command(flatten)]
pub repo_specifiers: HuggingFaceRepoSpecifiers,
#[command(flatten)]
pub output_args: OutputArgs<HuggingFaceOutputFormat>,
}
#[derive(Args, Debug, Clone, Default)]
pub struct HuggingFaceRepoSpecifiers {
#[arg(long = "huggingface-user")]
pub user: Vec<String>,
#[arg(long = "huggingface-organization", alias = "huggingface-org")]
pub organization: Vec<String>,
#[arg(long = "huggingface-model")]
pub model: Vec<String>,
#[arg(long = "huggingface-dataset")]
pub dataset: Vec<String>,
#[arg(long = "huggingface-space")]
pub space: Vec<String>,
#[arg(long = "huggingface-bucket", visible_alias = "bucket", alias = "hf-bucket")]
pub bucket: Vec<String>,
#[arg(long = "huggingface-exclude", value_name = "IDENTIFIER")]
pub exclude: Vec<String>,
}
impl HuggingFaceRepoSpecifiers {
pub fn is_empty(&self) -> bool {
self.user.is_empty()
&& self.organization.is_empty()
&& self.model.is_empty()
&& self.dataset.is_empty()
&& self.space.is_empty()
&& self.bucket.is_empty()
}
}
pub type HuggingFaceOutputFormat = GitHubOutputFormat;