add authors and copyright info to man page

This commit is contained in:
Terts Diepraam
2023-12-11 15:09:58 +01:00
parent cab0fb2cc9
commit 0bf84d5642
3 changed files with 12 additions and 1 deletions
+2
View File
@@ -28,6 +28,8 @@ pub struct Command<'a> {
pub version: &'a str,
pub after_options: &'a str,
pub args: Vec<Arg<'a>>,
pub license: &'a str,
pub authors: &'a str,
}
/// Description of an argument
+7
View File
@@ -57,5 +57,12 @@ pub fn render(c: &Command) -> String {
page.text(flags);
page.text([roman(arg.help)]);
}
page.control("SH", ["AUTHORS"]);
page.text([roman(c.authors)]);
page.control("SH", ["COPYRIGHT"]);
page.text([roman(format!("Copyright © {}.", &c.authors))]);
page.text([roman(format!("License: {}", &c.license))]);
page.render()
}