diff --git a/src/bin/todo/delete.rs b/src/bin/todo/delete.rs index a230449..9d4054f 100644 --- a/src/bin/todo/delete.rs +++ b/src/bin/todo/delete.rs @@ -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!") }