2022-08-16 15:43:44 +03:00
|
|
|
use crate::repo::Repository;
|
2022-08-05 16:48:22 +03:00
|
|
|
|
2022-08-16 15:43:44 +03:00
|
|
|
pub fn execute(repo: impl Repository) {
|
|
|
|
match repo.get_current_task_opt() {
|
|
|
|
Ok(None) => {
|
2022-08-05 22:13:25 +03:00
|
|
|
eprintln!("You don't have an active task.");
|
2022-08-05 16:48:22 +03:00
|
|
|
}
|
2022-08-16 15:43:44 +03:00
|
|
|
Ok(Some(info)) => {
|
2022-08-05 16:48:22 +03:00
|
|
|
println!("Information about your current task:");
|
|
|
|
println!(" {}", info.task.name);
|
|
|
|
if let Some(link) = info.task.link {
|
|
|
|
println!(" link: {}", link);
|
|
|
|
}
|
|
|
|
}
|
2022-08-16 15:43:44 +03:00
|
|
|
Err(err) => {
|
|
|
|
eprintln!("Cannot read current task: {}", err);
|
|
|
|
}
|
2022-08-05 16:48:22 +03:00
|
|
|
}
|
|
|
|
}
|