Skip to content

Commit

Permalink
feat: todo delete interface
Browse files Browse the repository at this point in the history
  • Loading branch information
GetPsyched committed Jul 2, 2024
1 parent c26113d commit cd1485e
Showing 1 changed file with 29 additions and 1 deletion.
30 changes: 29 additions & 1 deletion src/bin/todo/delete.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,36 @@
use clap::Parser;
use inquire::Select;
use mindmap::Task;

#[derive(Parser)]
pub struct Args {}

pub fn command(_args: &Args) {
println!("Deleted task successfully!")
let tasks = [
Task {
description: String::from("learn rust"),
difficulty: None,
priority: None,
deadline: None,
},
Task {
description: String::from("build mindmap cli"),
difficulty: None,
priority: None,
deadline: None,
},
Task {
description: String::from("build mindmap gui"),
difficulty: None,
priority: None,
deadline: None,
},
];
let task = Select::new(
"Select the task to delete:",
tasks.iter().map(|task| &task.description).collect(),
)
.prompt()
.expect("An error occurred!");
println!("Task \"{task}\" deleted successfully!")
}

0 comments on commit cd1485e

Please sign in to comment.