From 0c2e1910bd05ac7c783f0c815ca44539d9ff557e Mon Sep 17 00:00:00 2001 From: syn Date: Tue, 18 Feb 2020 00:54:44 +0300 Subject: Abort if no config found --- src/main.rs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src/main.rs') diff --git a/src/main.rs b/src/main.rs index e4c79ec..b25443d 100644 --- a/src/main.rs +++ b/src/main.rs @@ -41,7 +41,14 @@ fn main() { let src_path: std::path::PathBuf = matches.value_of("src") .expect("src is required") .into(); - let config = conf::get_conf(); + + let config = match conf::get_conf() { + Ok(c) => c, + Err(err) => { + error!("could not load config: {}", err); + std::process::exit(64); // EX_USAGE (BSD sysexits(3)) + } + }; if src_path.exists() { if let Some(backend) = config.get_backend(&src_path) { -- cgit v1.2.1-18-gbd029