Skip to content

Commit fb44a83

Browse files
unhappychoiceclaude
andcommitted
remove: CLI theme-related commands
- removed theme CLI commands as settings are now handled via GUI - users can now manage themes through the dedicated settings screen - simplifies CLI interface by focusing on core functionality 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 90fd06e commit fb44a83

File tree

2 files changed

+1
-102
lines changed

2 files changed

+1
-102
lines changed

src/cli/args.rs

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -80,11 +80,6 @@ pub enum Commands {
8080
#[command(subcommand)]
8181
repo_command: RepoCommands,
8282
},
83-
/// Manage color themes
84-
Theme {
85-
#[command(subcommand)]
86-
theme_command: ThemeCommands,
87-
},
8883
}
8984

9085
#[derive(Subcommand)]
@@ -110,22 +105,3 @@ pub enum RepoCommands {
110105
Play,
111106
}
112107

113-
#[derive(Subcommand)]
114-
pub enum ThemeCommands {
115-
/// List available themes
116-
List,
117-
/// Set the current theme
118-
Set {
119-
/// Theme name (default, original, ascii, or custom theme name)
120-
theme: String,
121-
},
122-
/// Show current theme
123-
Current,
124-
/// Set color mode (dark or light)
125-
Mode {
126-
/// Color mode (dark or light)
127-
mode: String,
128-
},
129-
/// Toggle color mode between dark and light
130-
Toggle,
131-
}

src/cli/runner.rs

Lines changed: 1 addition & 78 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use crate::cli::args::{CacheCommands, Cli, Commands, RepoCommands, ThemeCommands};
1+
use crate::cli::args::{CacheCommands, Cli, Commands, RepoCommands};
22
use crate::cli::commands::{
33
run_export, run_game_session, run_history, run_repo_clear, run_repo_list, run_repo_play,
44
run_stats,
@@ -20,7 +20,6 @@ pub async fn run_cli(cli: Cli) -> Result<()> {
2020
Some(Commands::Export { format, output }) => run_export(format.clone(), output.clone()),
2121
Some(Commands::Cache { cache_command }) => run_cache_command(cache_command),
2222
Some(Commands::Repo { repo_command }) => run_repo_command(repo_command),
23-
Some(Commands::Theme { theme_command }) => run_theme_command(theme_command),
2423
None => run_game_session(cli),
2524
}
2625
}
@@ -96,79 +95,3 @@ fn run_repo_command(repo_command: &RepoCommands) -> Result<()> {
9695
}
9796
}
9897

99-
fn run_theme_command(theme_command: &ThemeCommands) -> Result<()> {
100-
use crate::config::ConfigManager;
101-
use crate::ui::color_mode::ColorMode;
102-
use crate::ui::theme::Theme;
103-
104-
let mut config_manager = ConfigManager::new()
105-
.map_err(|e| crate::GitTypeError::TerminalError(e.to_string()))?;
106-
107-
match theme_command {
108-
ThemeCommands::List => {
109-
println!("Available themes:");
110-
let themes = Theme::all_themes();
111-
let current_theme_id = &config_manager.get_config().theme.current_theme.id;
112-
113-
for theme in themes {
114-
let current_indicator = if current_theme_id == &theme.id {
115-
" (current)"
116-
} else {
117-
""
118-
};
119-
println!(" {}{}", theme.id, current_indicator);
120-
}
121-
}
122-
ThemeCommands::Set { theme } => {
123-
let theme_obj = Theme::all_themes()
124-
.into_iter()
125-
.find(|t| t.id == *theme)
126-
.ok_or_else(|| crate::GitTypeError::TerminalError(format!("Unknown theme: {}", theme)))?;
127-
128-
config_manager.get_config_mut().theme.current_theme = theme_obj;
129-
config_manager.save()
130-
.map_err(|e| crate::GitTypeError::TerminalError(e.to_string()))?;
131-
132-
println!("Theme set to: {}", theme);
133-
}
134-
ThemeCommands::Current => {
135-
let current_theme = &config_manager.get_config().theme.current_theme.id;
136-
let current_mode = match config_manager.get_config().theme.current_color_mode {
137-
ColorMode::Dark => "dark",
138-
ColorMode::Light => "light",
139-
};
140-
println!("Current theme: {} ({})", current_theme, current_mode);
141-
}
142-
ThemeCommands::Mode { mode } => {
143-
let color_mode = match mode.to_lowercase().as_str() {
144-
"dark" => ColorMode::Dark,
145-
"light" => ColorMode::Light,
146-
_ => return Err(crate::GitTypeError::TerminalError(format!("Invalid color mode: {}. Use 'dark' or 'light'", mode))),
147-
};
148-
149-
config_manager.get_config_mut().theme.current_color_mode = color_mode;
150-
config_manager.save()
151-
.map_err(|e| crate::GitTypeError::TerminalError(e.to_string()))?;
152-
153-
println!("Color mode set to: {}", mode);
154-
}
155-
ThemeCommands::Toggle => {
156-
let new_mode = match config_manager.get_config().theme.current_color_mode {
157-
ColorMode::Dark => ColorMode::Light,
158-
ColorMode::Light => ColorMode::Dark,
159-
};
160-
161-
config_manager.get_config_mut().theme.current_color_mode = new_mode.clone();
162-
config_manager.save()
163-
.map_err(|e| crate::GitTypeError::TerminalError(e.to_string()))?;
164-
165-
let mode_str = match new_mode {
166-
ColorMode::Dark => "dark",
167-
ColorMode::Light => "light",
168-
};
169-
println!("Color mode toggled to: {}", mode_str);
170-
}
171-
}
172-
173-
Ok(())
174-
}

0 commit comments

Comments
 (0)