|
|
@ -37,6 +37,8 @@ fn main() {
|
|
|
|
]);
|
|
|
|
]);
|
|
|
|
#[cfg(feature = "cli-docs")]
|
|
|
|
#[cfg(feature = "cli-docs")]
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
use flate2::Compression;
|
|
|
|
|
|
|
|
use flate2::GzBuilder;
|
|
|
|
const MANDOC_OPTS: &[&'static str] = &["-T", "utf8", "-I", "os=Generated by mandoc(1)"];
|
|
|
|
const MANDOC_OPTS: &[&'static str] = &["-T", "utf8", "-I", "os=Generated by mandoc(1)"];
|
|
|
|
use std::env;
|
|
|
|
use std::env;
|
|
|
|
use std::fs::File;
|
|
|
|
use std::fs::File;
|
|
|
@ -45,7 +47,7 @@ fn main() {
|
|
|
|
use std::process::Command;
|
|
|
|
use std::process::Command;
|
|
|
|
let out_dir = env::var("OUT_DIR").unwrap();
|
|
|
|
let out_dir = env::var("OUT_DIR").unwrap();
|
|
|
|
let mut out_dir_path = Path::new(&out_dir).to_path_buf();
|
|
|
|
let mut out_dir_path = Path::new(&out_dir).to_path_buf();
|
|
|
|
out_dir_path.push("meli.txt");
|
|
|
|
out_dir_path.push("meli.txt.gz");
|
|
|
|
|
|
|
|
|
|
|
|
let output = Command::new("mandoc")
|
|
|
|
let output = Command::new("mandoc")
|
|
|
|
.args(MANDOC_OPTS)
|
|
|
|
.args(MANDOC_OPTS)
|
|
|
@ -54,11 +56,15 @@ fn main() {
|
|
|
|
.or_else(|_| Command::new("man").arg("-l").arg("docs/meli.1").output())
|
|
|
|
.or_else(|_| Command::new("man").arg("-l").arg("docs/meli.1").output())
|
|
|
|
.unwrap();
|
|
|
|
.unwrap();
|
|
|
|
|
|
|
|
|
|
|
|
let mut file = File::create(&out_dir_path).unwrap();
|
|
|
|
let file = File::create(&out_dir_path).unwrap();
|
|
|
|
file.write_all(&output.stdout).unwrap();
|
|
|
|
let mut gz = GzBuilder::new()
|
|
|
|
|
|
|
|
.comment(output.stdout.len().to_string().into_bytes())
|
|
|
|
|
|
|
|
.write(file, Compression::default());
|
|
|
|
|
|
|
|
gz.write_all(&output.stdout).unwrap();
|
|
|
|
|
|
|
|
gz.finish().unwrap();
|
|
|
|
out_dir_path.pop();
|
|
|
|
out_dir_path.pop();
|
|
|
|
|
|
|
|
|
|
|
|
out_dir_path.push("meli.conf.txt");
|
|
|
|
out_dir_path.push("meli.conf.txt.gz");
|
|
|
|
let output = Command::new("mandoc")
|
|
|
|
let output = Command::new("mandoc")
|
|
|
|
.args(MANDOC_OPTS)
|
|
|
|
.args(MANDOC_OPTS)
|
|
|
|
.arg("docs/meli.conf.5")
|
|
|
|
.arg("docs/meli.conf.5")
|
|
|
@ -70,11 +76,15 @@ fn main() {
|
|
|
|
.output()
|
|
|
|
.output()
|
|
|
|
})
|
|
|
|
})
|
|
|
|
.unwrap();
|
|
|
|
.unwrap();
|
|
|
|
let mut file = File::create(&out_dir_path).unwrap();
|
|
|
|
let file = File::create(&out_dir_path).unwrap();
|
|
|
|
file.write_all(&output.stdout).unwrap();
|
|
|
|
let mut gz = GzBuilder::new()
|
|
|
|
|
|
|
|
.comment(output.stdout.len().to_string().into_bytes())
|
|
|
|
|
|
|
|
.write(file, Compression::default());
|
|
|
|
|
|
|
|
gz.write_all(&output.stdout).unwrap();
|
|
|
|
|
|
|
|
gz.finish().unwrap();
|
|
|
|
out_dir_path.pop();
|
|
|
|
out_dir_path.pop();
|
|
|
|
|
|
|
|
|
|
|
|
out_dir_path.push("meli-themes.txt");
|
|
|
|
out_dir_path.push("meli-themes.txt.gz");
|
|
|
|
let output = Command::new("mandoc")
|
|
|
|
let output = Command::new("mandoc")
|
|
|
|
.args(MANDOC_OPTS)
|
|
|
|
.args(MANDOC_OPTS)
|
|
|
|
.arg("docs/meli-themes.5")
|
|
|
|
.arg("docs/meli-themes.5")
|
|
|
@ -86,7 +96,11 @@ fn main() {
|
|
|
|
.output()
|
|
|
|
.output()
|
|
|
|
})
|
|
|
|
})
|
|
|
|
.unwrap();
|
|
|
|
.unwrap();
|
|
|
|
let mut file = File::create(&out_dir_path).unwrap();
|
|
|
|
let file = File::create(&out_dir_path).unwrap();
|
|
|
|
file.write_all(&output.stdout).unwrap();
|
|
|
|
let mut gz = GzBuilder::new()
|
|
|
|
|
|
|
|
.comment(output.stdout.len().to_string().into_bytes())
|
|
|
|
|
|
|
|
.write(file, Compression::default());
|
|
|
|
|
|
|
|
gz.write_all(&output.stdout).unwrap();
|
|
|
|
|
|
|
|
gz.finish().unwrap();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|