use::clap::builder::{Command, Arg}; use::clap_mangen; fn main() -> std::io::Result<()> { let out_dir = std::path::PathBuf::from(std::env::var_os("OUT_DIR").ok_or_else(|| std::io::ErrorKind::NotFound)?); let cmd = Command::new("cli-me") .author("noshishi") .about("first cli") .version("version 0.1.0") .arg(Arg::new("generate") .short('g') .long("gene") .help("Generate sentence") .value_name("path")); let man = clap_mangen::Man::new(cmd); let mut buffer: Vec = Default::default(); man.render(&mut buffer)?; std::fs::write(out_dir.join("cli-me.1"), buffer)?; Ok(()) }