-
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.
Fix: Correct parameter in list_tasks
- Loading branch information
1 parent
ef00a9d
commit 57374cd
Showing
4 changed files
with
21 additions
and
20 deletions.
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
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,18 +1,20 @@ | ||
use chrono::Local; | ||
use clap::Parser; | ||
use mindmap::Task; | ||
|
||
#[derive(Parser)] | ||
pub struct Args {} | ||
|
||
pub async fn command(_args: &Args) { | ||
let rows = Task::list_tasks(true) | ||
let today = Local::now().date_naive(); | ||
let rows = Task::list_tasks(Some(today)) | ||
.await | ||
.expect("Failed to fetch today's tasks."); | ||
|
||
for row in rows { | ||
println!("------------------------\nTask: {}", row.description); | ||
println!("Priority: {:?}", row.priority); | ||
println!("Difficulty: {:?}", row.difficulty); | ||
println!("Deadline: {:?}\n------------------------\n", row.deadline); | ||
println!("Priority: {:?}", row.priority.unwrap()); | ||
println!("Difficulty: {:?}", row.difficulty.unwrap()); | ||
println!("Deadline: {:?}\n------------------------\n", row.deadline.unwrap()); | ||
} | ||
} |
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
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