diff --git a/src/cli/list.rs b/src/cli/list.rs index 3ed7fdd..9aa067b 100644 --- a/src/cli/list.rs +++ b/src/cli/list.rs @@ -30,10 +30,14 @@ pub fn execute(repo: impl Repository, args: Args) { Err(err) => return eprintln!("Cannot read tasks: {}", err), }; - let cur_task = match repo.get_current_task_opt() { - Ok(cur_task) => cur_task, - Err(err) => { - return eprintln!("Cannot read current task: {}", err); + let cur_task = if args.finished { + None + } else { + match repo.get_current_task_opt() { + Ok(cur_task) => cur_task, + Err(err) => { + return eprintln!("Cannot read current task: {}", err); + } } };