From fd637d2256b3a714e5e138167e79a303a8ab8019 Mon Sep 17 00:00:00 2001 From: Ottatop Date: Tue, 7 May 2024 20:12:55 -0500 Subject: [PATCH] Add some comments --- src/config.rs | 6 ++++++ src/main.rs | 3 +++ 2 files changed, 9 insertions(+) diff --git a/src/config.rs b/src/config.rs index c90ff01..bf5947d 100644 --- a/src/config.rs +++ b/src/config.rs @@ -75,6 +75,12 @@ pub struct Metaconfig { pub no_xwayland: Option, } +/// A metaconfig with fields resolved. +/// +/// The priority is: +/// 1. CLI options +/// 2. Metaconfig options +/// 3. Default metaconfig options where applicable #[derive(Debug, PartialEq)] pub struct ResolvedMetaconfig { pub command: Vec, diff --git a/src/main.rs b/src/main.rs index f5d0c49..0c86dba 100644 --- a/src/main.rs +++ b/src/main.rs @@ -136,6 +136,9 @@ async fn main() -> anyhow::Result<()> { .clone() .unwrap_or_else(|| get_config_dir(&base_dirs)); + // Parse the metaconfig once to resolve it with CLI flags. + // The metaconfig is parsed a second time when `start_config` + // is called below which is not ideal but I'm lazy. let metaconfig = match parse_metaconfig(&config_dir) { Ok(metaconfig) => metaconfig, Err(err) => {