opts.rs
1 use std::path::PathBuf; 2 3 use clap::{Parser, Subcommand}; 4 5 #[derive(Debug, Copy, Clone, Subcommand)] 6 pub enum Command { 7 Link, 8 Unlink, 9 } 10 11 #[derive(Parser, Debug, Clone)] 12 #[command(version, about)] 13 pub struct Options { 14 #[arg(long)] 15 pub dst_dir: PathBuf, 16 #[arg(long, default_value = ".")] 17 pub src_dir: PathBuf, 18 #[command(subcommand)] 19 pub command: Command, 20 /// Dry Run 21 #[arg(long)] 22 pub dry_run: bool, 23 /// Force file deletion/overwritting 24 #[arg(long)] 25 pub force: bool, 26 27 /// Paths to ignore 28 #[arg(long)] 29 pub ignore: Vec<PathBuf>, 30 31 #[clap(short, long, action = clap::ArgAction::Count)] 32 pub verbose: u8, 33 }