1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
//! CLI argument reducer module.
//!
//! This module implements a reducer-based architecture for processing CLI arguments,
//! following the same patterns as the pipeline reducer in `crate::reducer`.
//!
//! # Architecture
//!
//! ```text
//! Args (clap) → args_to_events() → [CliEvent] → reduce() → CliState → apply_to_config() → Config
//! ```
//!
//! ## Benefits
//!
//! - **Testable**: Pure reducer function is easy to unit test
//! - **Maintainable**: Adding new CLI args = add event + reducer case
//! - **Consistent**: Matches existing pipeline reducer architecture
//! - **Traceable**: Event sequence can be logged/debugged
//!
//! # Example
//!
//! ```ignore
//! use crate::cli::reducer::{args_to_events, reduce, CliState, apply_cli_state_to_config};
//!
//! let events = args_to_events(&args);
//! let mut state = CliState::initial();
//! for event in events {
//! state = reduce(state, event);
//! }
//! apply_cli_state_to_config(&state, &mut config);
//! ```
// Re-export key types for convenience
pub use apply_cli_state_to_config;
pub use args_to_events;
pub use CliState;
pub use reduce;
// Public API is exposed through presets::apply_args_to_config
// Modules are made public to allow imports from presets.rs
// Note: Only re-export items that are actually used to avoid unused-import suppressions.