1use clap::Args;
2use std::path::PathBuf;
3
4
5#[derive(Args)]
6pub struct DiffArgs {
7 #[arg(short, long)]
9 file1: Option<PathBuf>,
10
11 #[arg(short, long)]
12 file2: Option<PathBuf>,
13
14 #[arg(short, long)]
15 detailed: bool,
16}
17
18
19
20pub fn run(args: DiffArgs) -> anyhow::Result<()> {
21 let file1 = args.file1.unwrap_or_else(|| PathBuf::from("."));
22 let file2 = args.file2.unwrap_or_else(|| PathBuf::from("."));
23 let detailed = args.detailed;
24 crate::mds::diff::diff_command(file1, file2, detailed)
25 .map_err(|e| anyhow::anyhow!("Diff command failed: {}", e))?;
26 Ok(())
27}