use clap::{Parser, Subcommand};
use std::path::PathBuf;
#[derive(Parser)]
#[command(
name = "bond",
version,
about = "Manage directory bonds (symlinks with tracking)"
)]
pub struct Cli {
#[arg(long, global = true)]
pub db: Option<PathBuf>,
#[command(subcommand)]
pub command: Commands,
}
#[derive(Subcommand)]
pub enum Commands {
Add {
source: PathBuf,
target: Option<PathBuf>,
#[arg(long)]
contents: bool,
#[arg(long)]
name: Option<String>,
},
List,
Info {
id: String,
},
Remove {
id: String,
#[arg(long)]
with_target: bool,
},
Config {
#[command(subcommand)]
action: ConfigAction,
},
Update {
id: String,
#[arg(long)]
source: Option<PathBuf>,
#[arg(long)]
target: Option<PathBuf>,
#[arg(long)]
name: Option<String>,
},
Migrate {
id: String,
dest: Option<PathBuf>,
},
}
#[derive(Subcommand)]
pub enum ConfigAction {
Get {
key: String,
},
Set {
key: String,
value: String,
},
}