mirror of
https://github.com/asciinema/asciinema.git
synced 2025-12-15 19:28:00 +01:00
Render man page without a buffer
This commit is contained in:
7
build.rs
7
build.rs
@@ -1,7 +1,7 @@
|
||||
use clap::CommandFactory;
|
||||
use clap_mangen::Man;
|
||||
use std::env;
|
||||
use std::fs;
|
||||
use std::fs::File;
|
||||
use std::io;
|
||||
use std::path::PathBuf;
|
||||
|
||||
@@ -13,8 +13,7 @@ fn main() -> std::io::Result<()> {
|
||||
let out_dir = PathBuf::from(env::var_os("OUT_DIR").ok_or(io::ErrorKind::NotFound)?);
|
||||
let cmd = cli::Cli::command();
|
||||
let man = Man::new(cmd);
|
||||
let mut buffer: Vec<u8> = Default::default();
|
||||
man.render(&mut buffer)?;
|
||||
man.render(&mut File::create(out_dir.join("asciinema.1"))?)?;
|
||||
|
||||
fs::write(out_dir.join("asciinema.1"), buffer)
|
||||
Ok(())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user