Get list of finished tasks #32

Merged
pleshevskiy merged 5 commits from finished into main 2022-08-21 00:02:18 +03:00
Showing only changes of commit 73ab922c77 - Show all commits

View file

@ -30,10 +30,14 @@ pub fn execute(repo: impl Repository, args: Args) {
Err(err) => return eprintln!("Cannot read tasks: {}", err), Err(err) => return eprintln!("Cannot read tasks: {}", err),
}; };
let cur_task = match repo.get_current_task_opt() { let cur_task = if args.finished {
Ok(cur_task) => cur_task, None
Err(err) => { } else {
return eprintln!("Cannot read current task: {}", err); match repo.get_current_task_opt() {
Ok(cur_task) => cur_task,
Err(err) => {
return eprintln!("Cannot read current task: {}", err);
}
} }
}; };