torrust_tracker_deployer_lib/presentation/cli/controllers/run/mod.rs
1//! Run Command Presentation Module
2//!
3//! This module implements the CLI presentation layer for the run command,
4//! handling argument processing and user interaction.
5//!
6//! ## Architecture
7//!
8//! The run command presentation layer follows the DDD pattern, orchestrating
9//! the application layer's `RunCommandHandler` while providing user-friendly
10//! output and error handling.
11//!
12//! ## Components
13//!
14//! - `errors` - Presentation layer error types with `.help()` methods
15//! - `handler` - Main command handler orchestrating the workflow
16//!
17//! ## Usage Example
18//!
19//! ### Basic Usage
20//!
21//! ```ignore
22//! use std::path::Path;
23//! use std::sync::Arc;
24//! use torrust_tracker_deployer_lib::bootstrap::Container;
25//! use torrust_tracker_deployer_lib::presentation::cli::dispatch::ExecutionContext;
26//! use torrust_tracker_deployer_lib::presentation::cli::controllers::run;
27//! use torrust_tracker_deployer_lib::presentation::cli::views::VerbosityLevel;
28//!
29//! # #[tokio::main]
30//! # async fn main() {
31//! let container = Container::new(VerbosityLevel::Normal, Path::new("."));
32//! let context = ExecutionContext::new(Arc::new(container), global_args);
33//!
34//! // Call the run handler
35//! let result = context
36//! .container()
37//! .create_run_controller()
38//! .execute("my-environment")
39//! .await;
40//! # }
41//! ```
42
43pub mod errors;
44pub mod handler;
45pub use handler::RunCommandController;
46
47#[cfg(test)]
48mod tests;
49
50// Re-export commonly used types for convenience
51pub use errors::RunSubcommandError;