cli/list: don't show current task on finished

This commit is contained in:
Dmitriy Pleshevskiy 2022-08-21 00:01:00 +03:00
parent a8f8e23cf4
commit 73ab922c77
Signed by: pleshevskiy
GPG key ID: 1B59187B161C0215

View file

@ -30,11 +30,15 @@ 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 {
None
} else {
match repo.get_current_task_opt() {
Ok(cur_task) => cur_task, Ok(cur_task) => cur_task,
Err(err) => { Err(err) => {
return eprintln!("Cannot read current task: {}", err); return eprintln!("Cannot read current task: {}", err);
} }
}
}; };
let projects = args let projects = args