use std::path::PathBuf;
use clap::{Args, Parser, Subcommand, ValueEnum};
#[derive(Parser, Debug)]
#[command(
name = "llmlint",
version,
about = "LLM-as-judge linter for checks deterministic linters can't express.",
args_conflicts_with_subcommands = true
)]
pub struct Cli {
#[command(subcommand)]
pub command: Option<Command>,
#[command(flatten)]
pub lint: LintArgs,
}
#[derive(Subcommand, Debug)]
pub enum Command {
Lint(LintArgs),
Init(InitArgs),
Config(ConfigArgs),
Doctor,
}
#[derive(Args, Debug, Default)]
pub struct LintArgs {
pub files: Vec<PathBuf>,
#[arg(long = "config", short = 'c', value_name = "PATH")]
pub config: Vec<PathBuf>,
#[arg(long = "oneharness-config", value_name = "PATH")]
pub oneharness_config: Vec<PathBuf>,
#[arg(long = "oneharness-bin", value_name = "PATH")]
pub oneharness_bin: Option<String>,
#[arg(long = "agent", value_name = "NAME")]
pub agent: Option<String>,
#[arg(long = "rule", value_name = "NAME")]
pub rule: Vec<String>,
#[arg(long = "format", value_enum, default_value_t = OutputFormat::Human)]
pub format: OutputFormat,
#[arg(long = "max-parallel", value_name = "N")]
pub max_parallel: Option<usize>,
#[arg(long = "timeout", value_name = "SECS")]
pub timeout: Option<u64>,
#[arg(long = "cwd", value_name = "DIR")]
pub cwd: Option<PathBuf>,
}
#[derive(ValueEnum, Clone, Copy, Debug, Default, PartialEq, Eq)]
pub enum OutputFormat {
#[default]
Human,
Json,
}
#[derive(Args, Debug)]
pub struct InitArgs {
#[arg(long)]
pub global: bool,
#[arg(long = "with-template")]
pub with_template: bool,
#[arg(long)]
pub force: bool,
#[arg(long = "output", short = 'o', value_name = "PATH")]
pub output: Option<PathBuf>,
}
#[derive(Args, Debug, Default)]
pub struct ConfigArgs {
#[arg(long = "config", short = 'c', value_name = "PATH")]
pub config: Vec<PathBuf>,
#[arg(long = "cwd", value_name = "DIR")]
pub cwd: Option<PathBuf>,
}