diff options
| author | Kunal Mohan <kunalmohan99@gmail.com> | 2021-05-12 23:48:47 +0530 |
|---|---|---|
| committer | Kunal Mohan <kunalmohan99@gmail.com> | 2021-05-15 22:14:35 +0530 |
| commit | 378dd90f8f32d29557bb2437900e318faea460d2 (patch) | |
| tree | d0a6605508ba7bd1931cbb0e9c7bd69307808567 /src/main.rs | |
| parent | Fix after rebase (diff) | |
| download | sl0ppij-378dd90f8f32d29557bb2437900e318faea460d2.tar.gz sl0ppij-378dd90f8f32d29557bb2437900e318faea460d2.tar.xz sl0ppij-378dd90f8f32d29557bb2437900e318faea460d2.zip | |
Do not pass config_options while spawning server process
Diffstat (limited to 'src/main.rs')
| -rw-r--r-- | src/main.rs | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/main.rs b/src/main.rs index 25c363a5..2430d84a 100644 --- a/src/main.rs +++ b/src/main.rs @@ -14,7 +14,7 @@ use structopt::StructOpt; use crate::cli::CliArgs; use crate::command_is_executing::CommandIsExecuting; -use crate::common::input::{config::Config, options::Options}; +use crate::common::input::config::Config; use crate::os_input_output::{get_client_os_input, get_server_os_input}; use crate::utils::{ consts::{ZELLIJ_TMP_DIR, ZELLIJ_TMP_LOG_DIR}, @@ -24,6 +24,13 @@ use std::convert::TryFrom; pub fn main() { let opts = CliArgs::from_args(); + let config = match Config::try_from(&opts) { + Ok(config) => config, + Err(e) => { + eprintln!("There was an error in the config file:\n{}", e); + std::process::exit(1); + } + }; if let Some(crate::cli::ConfigCli::Setup(setup)) = opts.option.clone() { Setup::from_cli(&setup, opts).expect("Failed to print to stdout"); @@ -41,7 +48,7 @@ pub fn main() { atomic_create_dir(&*ZELLIJ_TMP_LOG_DIR).unwrap(); if let Some(path) = opts.server { let os_input = get_server_os_input(); - start_server(Box::new(os_input), path, config_options); + start_server(Box::new(os_input), path); } else { let os_input = get_client_os_input(); start_client(Box::new(os_input), opts, config); |
