diff --git a/src/commands/generate.rs b/src/commands/generate.rs index 50d80b2..baea79b 100644 --- a/src/commands/generate.rs +++ b/src/commands/generate.rs @@ -30,13 +30,34 @@ struct Metadata { impl Display for Metadata { fn fmt(&self, formatter: &mut Formatter) -> FormatResult { + let mut authors_lines: String = String::default(); + + if let Some(authors) = &self.authors { + for (index, author) in authors.iter().enumerate() { + authors_lines.push_str( + format!( + "Author n°{}\n\ + {}", + index + 1, + author + ) + .as_str(), + ); + + if index != authors.len() - 1 { + authors_lines.push_str("\n\n"); + } + } + } + write!( formatter, - "Generation file metadata\n\ + "Metadata\n\ Name: {}\n\ Version: {}\n\ - References: {:?}", - self.name, self.version, self.references + References: {:#?}\n\n\ + {}", + self.name, self.version, self.references, authors_lines ) } }