use clap::{Parser, ValueEnum};
use std::path::PathBuf;
#[derive(ValueEnum, Clone, Debug, serde::Serialize)]
pub enum ShredMethod {
Zero,
Random,
Dod,
Gutmann,
}
#[derive(ValueEnum, Clone, Debug, Default)]
pub enum AuditFormat {
#[default]
Text,
Json,
}
#[derive(Parser, Debug)]
#[command(
author = "V1lleneuve",
version = "1.1.1",
about = "Securely shreds files using cryptographic data and metadata obfuscation",
long_about = "A high-integrity secure deletion tool that bypasses OS file-system caching to ensure hardware-level data destruction."
)]
pub struct Args {
#[arg(
value_name = "PATH",
help = "Path to the file or directory to be destroyed"
)]
pub path: PathBuf,
#[arg(
short,
long,
default_value_t = 3,
help = "Number of cryptographic overwrite passes (Ignored for DoD/Gutmann)"
)]
pub passes: u32,
#[arg(
short,
long,
help = "Recursively destroy directories and their contents"
)]
pub recursive: bool,
#[arg(
short,
long,
value_enum,
default_value_t = ShredMethod::Random,
help = "Erasure method to utilize"
)]
pub method: ShredMethod,
#[arg(
long,
help = "Show what would be destroyed without performing actual deletion"
)]
pub dry_run: bool,
#[arg(long, help = "Enable read-back verification after each overwrite pass")]
pub verify: bool,
#[arg(
short,
long,
help = "Exclude files matching patterns (e.g. *.log, secret/*)"
)]
pub exclude: Vec<String>,
#[arg(
long,
help = "Send a TRIM/Discard command to the SSD after shredding (Linux/Windows only)"
)]
pub trim: bool,
#[arg(short, long, help = "Skip interactive confirmation prompts")]
pub force: bool,
#[arg(
long,
value_name = "LOG_PATH",
help = "Path to generate a forensic audit report"
)]
pub audit_log: Option<PathBuf>,
#[arg(
long,
value_enum,
default_value_t = AuditFormat::Text,
help = "Format of the audit report (text or json)"
)]
pub audit_format: AuditFormat,
#[arg(short, long, help = "Enable detailed debug output")]
pub verbose: bool,
#[arg(
long,
help = "Perform overwriting and obfuscation but do not delete the final file"
)]
pub keep: bool,
}