Skip to main content

torrust_tracker_deployer_lib/infrastructure/cli_docs/
mod.rs

1//! CLI JSON Documentation Generation Infrastructure
2//!
3//! This module provides infrastructure for generating JSON documentation from Clap CLI
4//! structures using runtime introspection. It provides a machine-readable,
5//! versionable specification of the CLI interface.
6//!
7//! ## Architecture
8//!
9//! This is an **Infrastructure Layer** component because:
10//! - Uses external dependency (Clap) introspection APIs
11//! - Pure technical mechanism with no business logic
12//! - Provides serialization/export functionality
13//!
14//! ## Usage
15//!
16//! ```rust
17//! use clap::Parser;
18//! use torrust_tracker_deployer_lib::infrastructure::cli_docs::CliDocsGenerator;
19//!
20//! #[derive(Parser)]
21//! struct MyCli {
22//!     #[arg(short, long)]
23//!     verbose: bool,
24//! }
25//!
26//! let docs = CliDocsGenerator::generate::<MyCli>()?;
27//! # Ok::<(), Box<dyn std::error::Error>>(())
28//! ```
29//!
30//! ## Module Structure
31//!
32//! - `generator` - Main documentation generator (`CliDocsGenerator`)
33//! - `schema_builder` - JSON building utilities
34//! - `errors` - Error types
35
36mod errors;
37mod generator;
38mod schema_builder;
39
40pub use errors::CliDocsGenerationError;
41pub use generator::CliDocsGenerator;