tas/src/cli/status.rs

20 lines
554 B
Rust

use crate::repo::Repository;
pub fn execute(repo: impl Repository) {
match repo.get_current_task_opt() {
Ok(None) => {
eprintln!("You don't have an active task.");
}
Ok(Some(info)) => {
println!("Information about your current task:");
println!(" {}", info.task.name);
if let Some(link) = info.task.link {
println!(" link: {}", link);
}
}
Err(err) => {
eprintln!("Cannot read current task: {}", err);
}
}
}