mirror of
https://github.com/bootandy/dust.git
synced 2026-06-08 11:29:05 +03:00
generate a man page as part of the build
This commit is contained in:
committed by
andy.boot
parent
810cc8b604
commit
fdbed14334
@@ -1,5 +1,8 @@
|
||||
use clap_complete::{generate_to, shells::*};
|
||||
use std::io::Error;
|
||||
use std::path::Path;
|
||||
use std::fs::File;
|
||||
use clap_mangen::Man;
|
||||
|
||||
include!("src/cli.rs");
|
||||
|
||||
@@ -14,5 +17,11 @@ fn main() -> Result<(), Error> {
|
||||
generate_to(PowerShell, &mut cmd, app_name, outdir)?;
|
||||
generate_to(Elvish, &mut cmd, app_name, outdir)?;
|
||||
|
||||
let file = Path::new("man-page").join("dust.1");
|
||||
std::fs::create_dir("man-page");
|
||||
let mut file = File::create(&file)?;
|
||||
|
||||
Man::new(cmd).render(&mut file)?;
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user