2024-03-29 04:21:51 +00:00
|
|
|
use clap::{Parser, Subcommand};
|
2024-03-28 23:05:09 +00:00
|
|
|
|
2024-03-29 04:18:38 +00:00
|
|
|
#[derive(Parser, Clone, Debug)]
|
2024-03-28 23:05:09 +00:00
|
|
|
pub struct Arguments {
|
|
|
|
#[command(subcommand)]
|
2024-03-29 14:37:06 +00:00
|
|
|
pub command: Commands,
|
2024-03-28 23:05:09 +00:00
|
|
|
}
|
|
|
|
|
2024-03-29 04:18:38 +00:00
|
|
|
#[derive(Subcommand, Clone, Debug)]
|
2024-03-28 23:05:09 +00:00
|
|
|
pub enum Commands {
|
2024-03-29 21:01:13 +00:00
|
|
|
/// Create a snapshot
|
2024-03-28 23:05:09 +00:00
|
|
|
Create {
|
2024-03-29 21:01:13 +00:00
|
|
|
/// Directory to create snapshot from
|
2024-03-28 23:05:09 +00:00
|
|
|
#[arg(short, long)]
|
|
|
|
root_dir: String,
|
2024-03-29 21:01:13 +00:00
|
|
|
/// Snapshot output/save location
|
2024-03-28 23:05:09 +00:00
|
|
|
#[arg(short, long)]
|
|
|
|
output_path: String,
|
|
|
|
},
|
2024-03-29 21:01:13 +00:00
|
|
|
/// Compare two snapshots
|
2024-03-28 23:05:09 +00:00
|
|
|
Compare {
|
2024-03-29 21:01:13 +00:00
|
|
|
/// left side of diff
|
2024-03-28 23:05:09 +00:00
|
|
|
#[arg(short, long)]
|
|
|
|
left: String,
|
2024-03-29 21:01:13 +00:00
|
|
|
/// right side of diff
|
2024-03-28 23:05:09 +00:00
|
|
|
#[arg(short, long)]
|
|
|
|
right: String,
|
2024-03-29 21:01:13 +00:00
|
|
|
/// OPTIONAL: specify which change type specifically to return
|
2024-03-29 04:18:38 +00:00
|
|
|
#[arg(short, long)]
|
|
|
|
selection: Option<String>,
|
2024-03-29 21:01:13 +00:00
|
|
|
/// OPTIONAL: when using selection specify to return count only or not
|
2024-03-29 20:45:08 +00:00
|
|
|
#[arg(short)]
|
2024-03-29 20:38:58 +00:00
|
|
|
count_only: Option<bool>,
|
2024-03-28 23:05:09 +00:00
|
|
|
},
|
|
|
|
}
|