Skip to content

Commit 16d6ed6

Browse files
committed
delete fromdb
1 parent e8df434 commit 16d6ed6

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/main.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,9 @@ pub struct Args {
5656
/// Clears the trash Directory
5757
#[clap(long)]
5858
clear: bool,
59+
60+
#[clap(long)]
61+
db_delete: Option<String>,
5962
}
6063

6164
impl Args {
@@ -85,6 +88,8 @@ impl Args {
8588
return InputType::Open;
8689
} else if let true = self.clear {
8790
return InputType::Clear;
91+
} else if let Some(_) = self.db_delete {
92+
return InputType::Dbdelete;
8893
} else {
8994
unreachable!()
9095
}
@@ -105,6 +110,7 @@ enum InputType {
105110
List,
106111
Open,
107112
Clear,
113+
Dbdelete,
108114
}
109115

110116
fn create_files(args: &Args) {
@@ -336,6 +342,8 @@ fn main() -> Result<(), Box<dyn Error>> {
336342
InputType::Open => open_file(&args)?,
337343

338344
InputType::Clear => clear_trash()?,
345+
346+
InputType::Dbdelete => db::delete(args.db_delete.unwrap()),
339347
}
340348
Ok(())
341349
}

0 commit comments

Comments
 (0)