vhost-device/xtask/Cargo.toml
Manos Pitsidianakis 427ea9655e Add an xtask crate to generate manpages
For information about the cargo xtask workflow pattern see: <https://github.com/matklad/cargo-xtask>

This commit adds an xtask crate with only one task, "mangen", which
generates a ROFF manual page under `target/dist/man` directory for the
vhost-device-sound binary.

The xtask crate can be configured using cargo features, to help
packagers configure what manpages are generated.

This generates a manpage in target/dist/man/vhost-device-sound.1

The rendered ROFF output looks like:

  vhost-device-sound(1)        General Commands Manual       vhost-device-sound(1)

  NAME
         vhost-device-sound - A virtio-sound device using the vhost-user protocol.

  SYNOPSIS
         vhost-device-sound <--socket> <--backend> [-h|--help] [-V|--version]

  DESCRIPTION
         A virtio-sound device using the vhost-user protocol.

  OPTIONS
         --socket=SOCKET
                vhost-user Unix domain socket path

         --backend=BACKEND
                audio backend to be used

                [possible values: null, pipewire, alsa]

         -h, --help
                Print help

         -V, --version
                Print version

  VERSION
         v0.2.0

  REPORTING BUGS
         Report bugs to the project's issue tracker: https://github.com/rust-vmm/vhost-device

                        vhost-device-sound 0.2.0      vhost-device-sound(1)

Fixes #687 ("Add man page for vhost-device-sound")

Resolves: https://github.com/rust-vmm/vhost-device/issues/687
Signed-off-by: Manos Pitsidianakis <manos.pitsidianakis@linaro.org>
2025-04-15 14:25:32 +05:30

27 lines
972 B
TOML

[package]
name = "xtask"
version = "0.1.0"
authors = ["Manos Pitsidianakis <manos.pitsidianakis@linaro.org>"]
description = "A helper binary crate following the cargo-xtask workflow recommended in <https://github.com/matklad/cargo-xtask>"
repository = "https://github.com/rust-vmm/vhost-device"
readme = "README.md"
license = "EUPL-1.2 OR GPL-3.0-or-later"
edition = "2021"
publish = false
[dependencies]
clap = { version = "4.5", features = ["derive"], optional = true }
clap_mangen = { version = "0.2.24", optional = true }
toml = { version = "0.8.19", optional = true }
[build-dependencies]
[features]
default = ["vhost-device-sound"]
vhost-device-sound = ["vhost-device-sound-alsa", "vhost-device-sound-pipewire"]
vhost-device-sound-alsa = ["mangen"]
vhost-device-sound-pipewire = ["mangen"]
mangen = ["dep:clap_mangen", "dep:clap", "dep:toml"]
[lints.rust]
unexpected_cfgs = { level = "allow", check-cfg = ['cfg(feature, values("alsa-backend", "pw-backend"))'] }