pub mod commands;
pub mod exit_codes;
pub mod output;
use clap::{Parser, Subcommand, ValueHint};
use std::path::PathBuf;
use commands::{
ApplyArgs, CompareArgs, CompletionsArgs, GenerateManArgs, InitArgs, InstallHooksArgs, PlanArgs,
ReportArgs, SchemaArgs,
};
#[derive(Parser, Debug)]
#[command(name = "repolens")]
#[command(author, version, about, long_about = None)]
#[command(propagate_version = true)]
pub struct Cli {
#[arg(short, long, action = clap::ArgAction::Count, global = true)]
pub verbose: u8,
#[arg(short, long, global = true, value_name = "FILE", value_hint = ValueHint::FilePath)]
pub config: Option<PathBuf>,
#[arg(short = 'C', long, global = true, value_name = "DIR", value_hint = ValueHint::DirPath)]
pub directory: Option<PathBuf>,
#[command(subcommand)]
pub command: Commands,
}
#[derive(Subcommand, Debug)]
pub enum Commands {
Init(InitArgs),
Plan(PlanArgs),
Apply(ApplyArgs),
Report(ReportArgs),
Schema(SchemaArgs),
Compare(CompareArgs),
InstallHooks(InstallHooksArgs),
#[command(hide = true)]
GenerateMan(GenerateManArgs),
#[command(hide = true)]
Completions(CompletionsArgs),
}