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 71394ec
Showing 1 changed file with 30 additions and 1 deletion.
31 changes: 30 additions & 1 deletion src/bin/todo/delete.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,37 @@
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_description = Select::new(
"Select the task to delete:",
tasks.iter().map(|task| &task.description).collect(),
)
.prompt()
.expect("An error occurred!");

println!("Task \"{}\" deleted successfully!", task_description);
}

0 comments on commit 71394ec

Please sign in to comment.