use clap::{Parser, Subcommand, builder::Styles};
const STYLES: Styles = Styles::styled()
.header(clap::builder::styling::AnsiColor::Green.on_default().bold())
.usage(clap::builder::styling::AnsiColor::Green.on_default().bold())
.literal(clap::builder::styling::AnsiColor::Cyan.on_default().bold())
.placeholder(clap::builder::styling::AnsiColor::Yellow.on_default());
#[derive(Parser, Debug)]
#[command(name = "reponest")]
#[command(author, version, about)]
#[command(styles = STYLES)]
#[command(
long_about = "A TUI/CLI tool for managing multiple git repositories written in Rust.\n\n\
By default (without subcommands), launches an interactive TUI.\n\
Use specified subcommands for non-interactive CLI output."
)]
#[command(after_long_help = "Examples:\n \
reponest [PATH] # Launch interactive TUI\n \
reponest --dirty [PATH] # Launch TUI, show only dirty repos\n \
reponest list [PATH] # List all repos (CLI)\n \
reponest list --detail [PATH] # List all repos with details (CLI)")]
pub struct CliArgs {
#[command(subcommand)]
pub command: Option<CliSubCommands>,
#[arg(global = true, value_name = "PATH")]
pub path: Option<String>,
#[arg(global = true, long, value_name = "DEPTH")]
pub max_depth: Option<usize>,
#[arg(global = true, long)]
pub dirty: bool,
#[arg(global = true, long)]
pub conflict: bool,
#[arg(
global = true,
short,
long,
value_name = "FILE",
help_heading = "Configuration"
)]
pub config: Option<String>,
#[arg(
global = true,
long,
value_name = "THEME",
help_heading = "Configuration"
)]
pub theme: Option<String>,
#[arg(global = true, long, help_heading = "Configuration")]
pub print_config: bool,
#[arg(global = true, long, value_name = "FILE")]
pub cwd_file: Option<String>,
}
#[derive(Subcommand, Debug)]
pub enum CliSubCommands {
#[command(visible_alias = "ls")]
List {
#[arg(long)]
detail: bool,
#[arg(long)]
json: bool,
},
}