aboutsummaryrefslogtreecommitdiffstats
path: root/src/common/mod.rs
diff options
context:
space:
mode:
authora-kenji <aks.kenji@protonmail.com>2021-03-05 22:40:42 +0100
committera-kenji <aks.kenji@protonmail.com>2021-03-09 19:16:15 +0100
commitc97c553870380956904ab7d2daa36e5ce0aef010 (patch)
treef84ac83057df1a5da72af1733ffc048555ad8b40 /src/common/mod.rs
parentpoking (diff)
downloadsl0ppij-c97c553870380956904ab7d2daa36e5ce0aef010.tar.gz
sl0ppij-c97c553870380956904ab7d2daa36e5ce0aef010.tar.xz
sl0ppij-c97c553870380956904ab7d2daa36e5ce0aef010.zip
feature(input): add config file
* use a simple platform dependent config location `ProjectDir` * deserialise from yaml iterate more on config format, maybe be more verbose? * make keybinds a tuple struct same size as newtype, but makes impls easier to add * merge optionally multiple keys for one keybinding easier configuration
Diffstat (limited to 'src/common/mod.rs')
-rw-r--r--src/common/mod.rs8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/common/mod.rs b/src/common/mod.rs
index c8b2ec98..fdd66649 100644
--- a/src/common/mod.rs
+++ b/src/common/mod.rs
@@ -29,6 +29,7 @@ use wasmer_wasi::{Pipe, WasiState};
use crate::cli::CliArgs;
use crate::common::config::Config;
use crate::layout::Layout;
+use crate::utils::logging::*;
use command_is_executing::CommandIsExecuting;
use errors::{AppContext, ContextType, ErrorContext, PluginContext, PtyContext, ScreenContext};
use input::handler::input_loop;
@@ -168,8 +169,13 @@ pub fn start(mut os_input: Box<dyn OsApi>, opts: CliArgs) {
let mut app_state = AppState::default();
+ #[allow(unused_must_use)]
let config = Config::from_option_or_default(opts.config)
- .map_err(|e| eprintln!{"Config Error: {}", e})
+ .map_err(|e| {
+ debug_log_to_file(format!("There was an error in the config file:\n{}", e));
+ eprintln!("There was an error in the config file:\n{}", e);
+ std::process::exit(1);
+ })
.unwrap();
let command_is_executing = CommandIsExecuting::new();