diff --git a/README.md b/README.md index 8e5e32f..d84c119 100644 --- a/README.md +++ b/README.md @@ -38,12 +38,15 @@ Here are the supported command-line options: ``` USAGE: - docuum + docuum [OPTIONS] OPTIONS: -d, --deletion-chunk-size Removes specified quantity of images at a time (default: 1) + -f, --fail-fast + Exits immediately on error instead of retrying + -h, --help Prints help information diff --git a/src/main.rs b/src/main.rs index 8a91d9a..7b5cbaa 100644 --- a/src/main.rs +++ b/src/main.rs @@ -203,7 +203,7 @@ fn settings() -> io::Result { Arg::with_name(FAIL_FAST) .short("f") .long(FAIL_FAST) - .help("Prevents restarting subprocess"), + .help("Exits immediately on error instead of retrying"), ) .get_matches(); @@ -280,10 +280,12 @@ fn main() { if let Err(e) = run(&settings, &mut state, &mut first_run) { error!("{}", e); if settings.fail_fast { - break; + error!("Exiting due to --fail-fast"); + exit(1); + } else { + error!("Retrying in 5 seconds\u{2026}"); + sleep(Duration::from_secs(5)); } - info!("Retrying in 5 seconds\u{2026}"); - sleep(Duration::from_secs(5)); } } }