mirror of
https://github.com/asciinema/asciinema.git
synced 2025-12-16 03:38:03 +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::CommandFactory;
|
||||||
use clap_mangen::Man;
|
use clap_mangen::Man;
|
||||||
use std::env;
|
use std::env;
|
||||||
use std::fs;
|
use std::fs::File;
|
||||||
use std::io;
|
use std::io;
|
||||||
use std::path::PathBuf;
|
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 out_dir = PathBuf::from(env::var_os("OUT_DIR").ok_or(io::ErrorKind::NotFound)?);
|
||||||
let cmd = cli::Cli::command();
|
let cmd = cli::Cli::command();
|
||||||
let man = Man::new(cmd);
|
let man = Man::new(cmd);
|
||||||
let mut buffer: Vec<u8> = Default::default();
|
man.render(&mut File::create(out_dir.join("asciinema.1"))?)?;
|
||||||
man.render(&mut buffer)?;
|
|
||||||
|
|
||||||
fs::write(out_dir.join("asciinema.1"), buffer)
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user