1use clap::{arg, Parser, Subcommand};
2#[derive(Parser, Debug)]
3#[command(name = "srm", version = "1.0")]
4#[command(author = "larpi")]
5#[command(
6 about = "Securely remove files or directories",
7 long_about = "This command removes files or directories by overwriting them with random data."
8)]
9pub struct Cli {
10 #[command(subcommand)]
11 pub command: Commands,
12}
13
14#[derive(Subcommand, Debug)]
15pub enum Commands {
16 Remove {
18 #[arg(short, long, value_name = "DURATION")]
20 duration: Option<String>,
21
22 #[arg(required = true, value_name = "FILE")]
24 files: Vec<String>,
25 },
26
27 Restore {
29 #[arg(short, long)]
31 all: bool,
32
33 #[arg(value_name = "FILE")]
35 files: Vec<String>,
36 },
37
38 List,
40
41 Clean {
43 #[arg(short, long)]
45 force: bool,
46 },
47
48 View {
50 #[arg(required = true, value_name = "FILE")]
52 files: Vec<String>,
53 },
54
55 Config {
57 #[command(subcommand)]
58 action: ConfigAction,
59 },
60}
61
62#[derive(Subcommand, Debug)]
63pub enum ConfigAction {
64 Set {
66 #[arg(value_name = "KEY")]
68 key: String,
69
70 #[arg(value_name = "VALUE")]
72 value: String,
73 },
74
75 Get {
77 #[arg(value_name = "KEY")]
79 key: String,
80 },
81}