xtask: generate manpage for vhost-device-scsi

Signed-off-by: Manos Pitsidianakis <manos.pitsidianakis@linaro.org>
This commit is contained in:
Manos Pitsidianakis 2025-11-12 13:51:48 +02:00 committed by Stefano Garzarella
parent 35a2f6627b
commit 5e83c07f87
3 changed files with 17 additions and 1 deletions

View File

@ -18,8 +18,9 @@ markdown = { version = "=1.0.0", optional = true }
[build-dependencies]
[features]
default = ["vhost-device-sound", "vhost-device-scmi"]
default = ["vhost-device-sound", "vhost-device-scmi", "vhost-device-scsi"]
vhost-device-scmi = []
vhost-device-scsi = []
vhost-device-sound = ["vhost-device-sound-alsa", "vhost-device-sound-pipewire"]
vhost-device-sound-alsa = ["mangen"]
vhost-device-sound-pipewire = ["mangen"]

View File

@ -22,3 +22,4 @@ The following crates have manual pages built by default:
- [`vhost-device-sound`](../vhost-device-sound), enabled by the default feature `vhost-device-sound`.
- It can further be fine-tuned with the features `vhost-device-sound-pipewire` and `vhost-device-sound-alsa`.
- [`vhost-device-scmi`](../vhost-device-scmi), enabled by the default feature `vhost-device-scmi`.
- [`vhost-device-scsi`](../vhost-device-scsi), enabled by the default feature `vhost-device-scsi`.

View File

@ -34,6 +34,12 @@ mod vhost_device_sound;
#[path = "../../vhost-device-scmi/src/args.rs"]
mod vhost_device_scmi;
// Use vhost-device-scsi's args module as our own using the #[path] attribute
#[cfg(feature = "vhost-device-scsi")]
#[path = "../../vhost-device-scsi/src/args.rs"]
mod vhost_device_scsi;
fn main() {
if let Err(err) = run_app() {
eprintln!("{err}");
@ -193,6 +199,14 @@ fn mangen() -> Result<(), Box<dyn Error>> {
let man_path = dist_dir.join("vhost-device-scmi.1");
buffers.push((man_path, buffer));
}
#[cfg(feature = "vhost-device-scsi")]
{
use vhost_device_scsi::ScsiArgs;
let buffer = mangen_for_crate::<ScsiArgs>(workspace_dir.join("vhost-device-scsi"))?;
let man_path = dist_dir.join("vhost-device-scsi.1");
buffers.push((man_path, buffer));
}
if buffers.is_empty() {
println!("No manpages were generated! Try using the correct xtask cargo features.");