Skip to main content

spec_driven_docs/commands/
hooks.rs

1//! `hooks` subcommand: runtime-shape.
2//!
3//! Renders the managed block to stdout. What the render contains is the
4//! renderer's business; this handler only projects the flags.
5
6use crate::cli::hooks::HooksArgs;
7use crate::context::AppContext;
8use crate::error::AppError;
9use crate::output;
10use crate::services::hooks_render::{RenderOptions, render_block};
11
12/// Render the delivered gate set.
13///
14/// # Errors
15///
16/// None; rendering is pure.
17pub fn run(_ctx: &AppContext, args: HooksArgs) -> Result<(), AppError> {
18    let rendered = render_block(&RenderOptions {
19        docs_root: args.docs_root,
20        entry: args.entry,
21        indent: args.indent,
22    });
23    output::line(rendered.trim_end_matches('\n'));
24    Ok(())
25}