xtask: generate manpage for vhost-device-scsi
Signed-off-by: Manos Pitsidianakis <manos.pitsidianakis@linaro.org>
This commit is contained in:
parent
35a2f6627b
commit
5e83c07f87
3 changed files with 17 additions and 1 deletions
|
|
@ -18,8 +18,9 @@ markdown = { version = "=1.0.0", optional = true }
|
||||||
[build-dependencies]
|
[build-dependencies]
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
default = ["vhost-device-sound", "vhost-device-scmi"]
|
default = ["vhost-device-sound", "vhost-device-scmi", "vhost-device-scsi"]
|
||||||
vhost-device-scmi = []
|
vhost-device-scmi = []
|
||||||
|
vhost-device-scsi = []
|
||||||
vhost-device-sound = ["vhost-device-sound-alsa", "vhost-device-sound-pipewire"]
|
vhost-device-sound = ["vhost-device-sound-alsa", "vhost-device-sound-pipewire"]
|
||||||
vhost-device-sound-alsa = ["mangen"]
|
vhost-device-sound-alsa = ["mangen"]
|
||||||
vhost-device-sound-pipewire = ["mangen"]
|
vhost-device-sound-pipewire = ["mangen"]
|
||||||
|
|
|
||||||
|
|
@ -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`.
|
- [`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`.
|
- 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-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`.
|
||||||
|
|
|
||||||
|
|
@ -34,6 +34,12 @@ mod vhost_device_sound;
|
||||||
#[path = "../../vhost-device-scmi/src/args.rs"]
|
#[path = "../../vhost-device-scmi/src/args.rs"]
|
||||||
mod vhost_device_scmi;
|
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() {
|
fn main() {
|
||||||
if let Err(err) = run_app() {
|
if let Err(err) = run_app() {
|
||||||
eprintln!("{err}");
|
eprintln!("{err}");
|
||||||
|
|
@ -193,6 +199,14 @@ fn mangen() -> Result<(), Box<dyn Error>> {
|
||||||
let man_path = dist_dir.join("vhost-device-scmi.1");
|
let man_path = dist_dir.join("vhost-device-scmi.1");
|
||||||
buffers.push((man_path, buffer));
|
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() {
|
if buffers.is_empty() {
|
||||||
println!("No manpages were generated! Try using the correct xtask cargo features.");
|
println!("No manpages were generated! Try using the correct xtask cargo features.");
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue