Fixed error handling.

Signed-off-by: Pavel Kirilin <win10@list.ru>
This commit is contained in:
2020-04-05 21:40:56 +04:00
parent 60b10d9dd0
commit 9d81cf5dc6
7 changed files with 31 additions and 7 deletions

View File

@ -2,7 +2,7 @@ use crate::{Opt, RunMode};
use crate::result::{AppResult, AppError};
use crate::initialization::init_config;
use crate::config::{update_episode, update_config, Config};
use std::process::{Command};
use std::process::Command;
pub fn run(opts: Opt) -> AppResult<()> {
let mode = opts.mode.unwrap_or_else(|| RunMode::Play);
@ -22,6 +22,9 @@ pub fn run(opts: Opt) -> AppResult<()> {
RunMode::Update => {
update_config()
}
RunMode::Reset => {
update_episode(|_| { Ok(0) })
}
}
}