From 0f10a3519301bb72961e70b799a15f987ea09bb5 Mon Sep 17 00:00:00 2001 From: Hakki Date: Sat, 17 Aug 2024 22:20:57 +0200 Subject: [PATCH] manpage: changed the folder to man --- build.rs | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/build.rs b/build.rs index 0a2fe07..ca3046c 100644 --- a/build.rs +++ b/build.rs @@ -1,11 +1,14 @@ include!("src/bin/topola/cli.rs"); use clap_mangen::Man; use clap::CommandFactory; -use std::fs::File; +use std::fs::{File, create_dir_all}; +// https://rust-cli.github.io/book/in-depth/docs.html fn main() -> Result<(), Box> { - let cli = Cli::command(); - let man = Man::new(cli); - let mut file = File::create(concat!("assets", "/topola.1"))?; + let cmd = Cli::command(); + let man = Man::new(cmd); + let folder = "man"; + create_dir_all(folder)?; + let mut file = File::create(format!("{}/topola.1", folder))?; man.render(&mut file)?; Ok(()) }