mirror of
https://github.com/MidnightBlueLabs/tetra-bluestation.git
synced 2026-03-29 05:09:51 +00:00
Large config file parsing refactor, also ensured all fields actually affect stack
This commit is contained in:
@@ -3,7 +3,7 @@ use clap::Parser;
|
||||
use std::sync::Arc;
|
||||
use std::sync::atomic::{AtomicBool, Ordering};
|
||||
|
||||
use tetra_config::{PhyBackend, SharedConfig, StackMode, toml_config};
|
||||
use tetra_config::bluestation::{PhyBackend, SharedConfig, StackMode, parsing};
|
||||
use tetra_core::{TdmaTime, debug};
|
||||
use tetra_entities::MessageRouter;
|
||||
use tetra_entities::brew::entity::BrewEntity;
|
||||
@@ -20,7 +20,7 @@ use tetra_entities::{
|
||||
|
||||
/// Load configuration file
|
||||
fn load_config_from_toml(cfg_path: &str) -> SharedConfig {
|
||||
match toml_config::from_file(cfg_path) {
|
||||
match parsing::from_file(cfg_path) {
|
||||
Ok(c) => c,
|
||||
Err(e) => {
|
||||
println!("Failed to load configuration from {}: {}", cfg_path, e);
|
||||
@@ -98,6 +98,7 @@ fn main() {
|
||||
|
||||
let args = Args::parse();
|
||||
let mut cfg = load_config_from_toml(&args.config);
|
||||
eprintln!("Loaded configuration from {:?}", cfg.config());
|
||||
let _log_guard = debug::setup_logging_default(cfg.config().debug_log.clone());
|
||||
|
||||
let mut router = match cfg.config().stack_mode {
|
||||
|
||||
Reference in New Issue
Block a user