spec-driven-docs 0.8.1

Spec-driven documentation: current specs, immutable decision records, and executable gates kept coherent for people and coding agents.
Documentation
//! `completions` subcommand: runtime-shape.
//!
//! Generates shell completions for the full command surface to stdout.

use clap::CommandFactory;

use crate::cli::completions::CompletionsArgs;
use crate::context::AppContext;
use crate::error::AppError;
use crate::output;

/// Generate completions for one shell.
///
/// # Errors
///
/// None.
pub fn run(_ctx: &AppContext, args: CompletionsArgs) -> Result<(), AppError> {
    let mut buffer = Vec::new();
    clap_complete::generate(
        args.shell,
        &mut crate::cli::Cli::command(),
        "sdd",
        &mut buffer,
    );
    output::raw(&buffer);
    Ok(())
}