Add some comments

This commit is contained in:
Ottatop 2024-05-07 20:12:55 -05:00
parent 6802afe04a
commit fd637d2256
2 changed files with 9 additions and 0 deletions

View file

@ -75,6 +75,12 @@ pub struct Metaconfig {
pub no_xwayland: Option<bool>,
}
/// 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<String>,

View file

@ -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) => {