diff --git a/src/main.rs b/src/main.rs index e538aff..45ce815 100644 --- a/src/main.rs +++ b/src/main.rs @@ -653,11 +653,17 @@ fn handle_relative_connection( .parent() .map(|parent| parent.with_extension("mlc")); + enum SectionInfo { + Description, + Comment(Vec), + } + #[derive(Default)] struct Section { title: Box, lines: Vec, config_map: Option, Box>>, + info: Option, } let mut sections = Vec::new(); @@ -667,6 +673,7 @@ fn handle_relative_connection( title: "Game".into(), lines: Vec::new(), config_map, + info: None, }); } else { let Ok(pk_file) = File::open(file_paths.pk) else { @@ -687,6 +694,7 @@ fn handle_relative_connection( title: title.into(), lines: vec![line], config_map: None, + info: None, }; continue; @@ -698,6 +706,22 @@ fn handle_relative_connection( sections.push(current_section); } + if file_paths.pki.is_some() { + sections.push(Section { + title: "Description".into(), + lines: Vec::new(), + config_map: None, + info: Some(SectionInfo::Description), + }); + } + + sections.push(Section { + title: "Comments".into(), + lines: Vec::new(), + config_map: None, + info: Some(SectionInfo::Comment(comments)), + }); + let count = sections.len(); let _ = write!(stream, "