diff options
author | Thomas Otto <th1000s@posteo.net> | 2021-10-14 00:15:56 +0200 |
---|---|---|
committer | Thomas Otto <th1000s@posteo.net> | 2021-10-16 14:07:28 +0200 |
commit | 636b56729be21a17a5520988f0d23f5d26e9a277 (patch) | |
tree | 93098335afe26490f872fc937fff4683e32a2036 /src/config.rs | |
parent | 85ba3ba5782e04d514998f33f97b5f44cf859e86 (diff) |
Add fatal() function to handle exiting on errors
Panic when testing or exit with return value 2.
Diffstat (limited to 'src/config.rs')
-rw-r--r-- | src/config.rs | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/config.rs b/src/config.rs index fbd58044..5a013a1b 100644 --- a/src/config.rs +++ b/src/config.rs @@ -13,6 +13,7 @@ use crate::cli; use crate::color; use crate::delta::State; use crate::env; +use crate::fatal; use crate::features::navigate; use crate::features::side_by_side; use crate::git_config::{GitConfig, GitConfigEntry}; @@ -193,10 +194,7 @@ impl From<cli::Opt> for Config { // Note that "default" is not documented Some("ansi") | Some("default") | None => BgFillMethod::TryAnsiSequence, Some("spaces") => BgFillMethod::Spaces, - _ => { - eprintln!("Invalid option for line-fill-method: Expected \"ansi\" or \"spaces\"."); - process::exit(1); - } + _ => fatal("Invalid option for line-fill-method: Expected \"ansi\" or \"spaces\"."), }; let navigate_regexp = if opt.navigate || opt.show_themes { |