1use clap::{Parser, ValueEnum};
8use std::path::PathBuf;
9
10#[derive(ValueEnum, Clone, Debug, serde::Serialize)]
12pub enum ShredMethod {
13 Zero,
15 Random,
17 Dod,
19 Gutmann,
21}
22
23#[derive(ValueEnum, Clone, Debug, Default)]
25pub enum AuditFormat {
26 #[default]
28 Text,
29 Json,
31}
32
33#[derive(Parser, Debug)]
40#[command(
41 author = "V1lleneuve",
42 version = "1.0.0",
43 about = "Securely shreds files using cryptographic data and metadata obfuscation",
44 long_about = "A high-integrity secure deletion tool that bypasses OS file-system caching to ensure hardware-level data destruction."
45)]
46pub struct Args {
47 #[arg(
49 value_name = "PATH",
50 help = "Path to the file or directory to be destroyed"
51 )]
52 pub path: PathBuf,
53
54 #[arg(
56 short,
57 long,
58 default_value_t = 3,
59 help = "Number of cryptographic overwrite passes (Ignored for DoD/Gutmann)"
60 )]
61 pub passes: u32,
62
63 #[arg(
65 short,
66 long,
67 help = "Recursively destroy directories and their contents"
68 )]
69 pub recursive: bool,
70
71 #[arg(
73 short,
74 long,
75 value_enum,
76 default_value_t = ShredMethod::Random,
77 help = "Erasure method to utilize"
78 )]
79 pub method: ShredMethod,
80
81 #[arg(
83 long,
84 help = "Show what would be destroyed without performing actual deletion"
85 )]
86 pub dry_run: bool,
87
88 #[arg(long, help = "Enable read-back verification after each overwrite pass")]
90 pub verify: bool,
91
92 #[arg(
94 short,
95 long,
96 help = "Exclude files matching patterns (e.g. *.log, secret/*)"
97 )]
98 pub exclude: Vec<String>,
99
100 #[arg(
102 long,
103 help = "Send a TRIM/Discard command to the SSD after shredding (Linux/Windows only)"
104 )]
105 pub trim: bool,
106
107 #[arg(short, long, help = "Skip interactive confirmation prompts")]
109 pub force: bool,
110
111 #[arg(
114 long,
115 value_name = "LOG_PATH",
116 help = "Path to generate a forensic audit report"
117 )]
118 pub audit_log: Option<PathBuf>,
119
120 #[arg(
122 long,
123 value_enum,
124 default_value_t = AuditFormat::Text,
125 help = "Format of the audit report (text or json)"
126 )]
127 pub audit_format: AuditFormat,
128
129 #[arg(short, long, help = "Enable detailed debug output")]
131 pub verbose: bool,
132
133 #[arg(
135 long,
136 help = "Perform overwriting and obfuscation but do not delete the final file"
137 )]
138 pub keep: bool,
139}