use std::path::PathBuf;
use clap::{Parser, Subcommand, ValueEnum};
use clap_complete::Shell;
#[derive(Parser)]
#[command(version, about)]
pub struct Cli {
#[command(subcommand)]
pub command: Commands,
}
#[derive(Subcommand)]
pub enum Commands {
Init {
#[arg(long)]
path: Option<PathBuf>,
},
Add {
branch: Option<String>,
#[arg(long)]
base: Option<String>,
#[arg(long)]
path: Option<PathBuf>,
},
#[command(alias = "ls")]
List {
#[arg(long)]
compact: bool,
},
#[command(alias = "rm")]
Remove {
name: Option<String>,
#[arg(long = "match", value_enum, default_value_t = RemoveMatchMode::Auto)]
match_mode: RemoveMatchMode,
#[arg(long)]
delete_branch: bool,
#[arg(long)]
force: bool,
},
Completions {
shell: Shell,
},
}
#[derive(Copy, Clone, Debug, Eq, PartialEq, ValueEnum)]
pub enum RemoveMatchMode {
Auto,
Branch,
Dir,
}