-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(build): add cargo deps and build.rs for mangen poc
Signed-off-by: Sandro-Alessio Gierens <sandro@gierens.de>
- Loading branch information
Showing
2 changed files
with
26 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#[allow(dead_code)] | ||
fn mangen() -> std::io::Result<()> { | ||
let out_dir = std::path::PathBuf::from(std::env::var_os("OUT_DIR").ok_or(std::io::ErrorKind::NotFound)?); | ||
|
||
let cmd = clap::Command::new("wikijs") | ||
.arg(clap::arg!(-u --url <URL>)); | ||
// .arg(clap::arg!(-c --count <NUM>)); | ||
|
||
let man = clap_mangen::Man::new(cmd); | ||
let mut buffer: Vec<u8> = Default::default(); | ||
man.render(&mut buffer)?; | ||
|
||
std::fs::write(out_dir.join("wikijs.1"), buffer)?; | ||
|
||
Ok(()) | ||
} | ||
|
||
fn main() -> std::io::Result<()> { | ||
#[cfg(feature = "cli")] | ||
mangen()?; | ||
Ok(()) | ||
} |