Skip to main content

torrust_tracker_deployer_lib/presentation/cli/controllers/docs/
mod.rs

1//! Docs Command Controller (Presentation Layer)
2//!
3//! This module handles the presentation layer concerns for CLI JSON documentation
4//! generation, including user output and progress reporting.
5//!
6//! # Architecture
7//!
8//! - **Controller**: Coordinates between application handler and user output
9//! - **Errors**: Presentation layer error wrapping
10//! - **Progress Reporting**: Provides user feedback during generation
11//!
12//! # Usage
13//!
14//! ```rust,no_run
15//! use std::sync::Arc;
16//! use std::path::PathBuf;
17//! use torrust_tracker_deployer_lib::presentation::cli::controllers::docs::DocsCommandController;
18//! use torrust_tracker_deployer_lib::presentation::cli::views::{UserOutput, VerbosityLevel};
19//! use std::cell::RefCell;
20//! use parking_lot::ReentrantMutex;
21//!
22//! // Setup user output
23//! let user_output = Arc::new(ReentrantMutex::new(RefCell::new(
24//!     UserOutput::new(VerbosityLevel::Normal)
25//! )));
26//! let mut controller = DocsCommandController::new(&user_output);
27//!
28//! // Generate to file
29//! let output_path = PathBuf::from("docs/cli/commands.json");
30//! controller.execute(Some(&output_path))?;
31//! # Ok::<(), Box<dyn std::error::Error>>(())
32//! ```
33
34mod errors;
35mod handler;
36
37pub use errors::DocsCommandError;
38pub use handler::DocsCommandController;