-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c26113d
commit 71394ec
Showing
1 changed file
with
30 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
} |