Skip to main content

spec_driven_docs/commands/
man.rs

1//! `man` subcommand: runtime-shape.
2//!
3//! Renders the manual page for the full command surface to stdout.
4
5use clap::CommandFactory;
6
7use crate::context::AppContext;
8use crate::error::AppError;
9use crate::output;
10
11/// Render the manual page.
12///
13/// # Errors
14///
15/// [`AppError::Io`] when rendering fails.
16pub fn run(_ctx: &AppContext) -> Result<(), AppError> {
17    let mut buffer = Vec::new();
18    clap_mangen::Man::new(crate::cli::Cli::command()).render(&mut buffer)?;
19    output::raw(&buffer);
20    Ok(())
21}