use clap::Parser;
use crate::model::{AbsolutePathBuf, RepoPath};
#[derive(Parser)]
pub struct Args {
#[arg(default_value = ".", value_parser = parse_repo_path)]
pub repo_path: RepoPath,
#[arg(long, short = 'n')]
pub dry_run: bool,
}
fn parse_repo_path(path_arg: &str) -> Result<RepoPath, String> {
let path = AbsolutePathBuf::canonicalize(path_arg).map_err(|error| error.to_string())?;
RepoPath::new(&path).map_err(|error| error.to_string())
}