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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
//! Configuration management command-line arguments and operations.
//!
//! This module defines the command-line interface for configuration management
//! in SubX. It provides comprehensive tools for viewing, modifying, and maintaining
//! configuration settings that control various aspects of subtitle processing,
//! AI integration, and application behavior.
//!
//! # Configuration System
//!
//! SubX uses a hierarchical configuration system with multiple sources:
//! - **System-wide**: Global defaults for all users
//! - **User-specific**: Personal settings in user config directory
//! - **Project-specific**: Local settings for specific projects
//! - **Environment variables**: Runtime configuration overrides
//! - **Command-line**: Highest priority, temporary overrides
//!
//! # Configuration Categories
//!
//! - **General**: Basic application behavior and preferences
//! - **AI Settings**: API endpoints, models, and parameters
//! - **Audio Processing**: Audio analysis and synchronization settings
//! - **Format Options**: Default output formats and encoding preferences
//! - **Performance**: Parallel processing and caching configuration
//!
//! # Examples
//!
//! ```bash
//! # View all configuration settings
//! subx config list
//!
//! # Get specific setting
//! subx config get ai.provider
//!
//! # Set AI provider
//! subx config set ai.provider openai
//! subx config set ai.provider openrouter
//!
//! # Reset to defaults
//! subx config reset
//! ```
//! # Advanced Usage Examples
//!
//! ## Setting Complex Values
//! ```bash
//! # Set AI provider with API key
//! subx-cli config set ai.provider openai
//! subx-cli config set ai.provider openrouter
//! subx-cli config set ai.api_key "sk-1234567890abcdef"
//! subx-cli config set ai.api_key "test-openrouter-key"
//! subx-cli config set ai.base_url "https://api.openai.com/v1"
//! subx-cli config set ai.model "deepseek/deepseek-r1-0528:free"
//!
//! # Configure audio processing and VAD settings
//! subx-cli config set sync.max_offset_seconds 15.0
//! subx-cli config set sync.default_method vad
//! subx-cli config set sync.vad.enabled true
//! subx-cli config set sync.vad.sensitivity 0.8
//!
//! # Set performance options
//! subx-cli config set parallel.max_workers 4
//! subx-cli config set general.max_concurrent_jobs 8
//! ```
//!
//! ## Boolean Value Formats
//! ```bash
//! # All of these set the value to true
//! subx-cli config set general.backup_enabled true
//! subx-cli config set general.backup_enabled 1
//! subx-cli config set general.backup_enabled yes
//! subx-cli config set general.backup_enabled on
//! subx-cli config set general.backup_enabled enabled
//!
//! # All of these set the value to false
//! subx-cli config set general.backup_enabled false
//! subx-cli config set general.backup_enabled 0
//! subx-cli config set general.backup_enabled no
//! subx-cli config set general.backup_enabled off
//! subx-cli config set general.backup_enabled disabled
//! ```
//!
//! ## Clearing Optional Values
//! ```bash
//! # Clear API key (set to None)
//! subx-cli config set ai.api_key ""
//! ```
// src/cli/config_args.rs
use ;
/// Command-line arguments for configuration management operations.
/// Configuration management operations and subcommands.
///
/// Defines the available configuration management operations that can be
/// performed through the SubX CLI. Each operation provides specific
/// functionality for different aspects of configuration management.
///
/// # Operation Categories
///
/// - **Viewing**: Get and list operations for inspecting settings
/// - **Modification**: Set operation for changing configuration values
/// - **Maintenance**: Reset operation for restoring defaults
///
/// # Validation and Safety
///
/// All configuration operations include:
/// - **Type validation**: Ensure values match expected data types
/// - **Range checking**: Validate numeric values are within acceptable ranges
/// - **Format verification**: Check string values follow required patterns
/// - **Dependency checking**: Verify related settings are compatible
///
/// # Examples
///
/// ```rust
/// use subx_cli::cli::ConfigAction;
///
/// // Different configuration operations
/// let set_provider = ConfigAction::Set {
/// key: "ai.provider".to_string(),
/// value: "openai".to_string(),
/// };
///
/// let get_provider = ConfigAction::Get {
/// key: "ai.provider".to_string(),
/// };
///
/// let list_all = ConfigAction::List;
/// let reset_config = ConfigAction::Reset;
/// ```