1use crate::command::Command;
2use crate::config::CliConfig;
3use crate::console::run_shell;
4
5pub struct ShellCommand;
6
7impl Command for ShellCommand {
8 fn name(&self) -> &'static str {
9 "shell"
10 }
11
12 fn help(&self) -> Option<&str> {
13 Some("Launch interactive shell")
14 }
15
16 fn validate(&self, args: &[String]) -> Result<(), String> {
17 if !args.is_empty() {
18 Err("Shell does not accept any arguments.".into())
19 } else {
20 Ok(())
21 }
22 }
23
24 fn execute(&self, _args: &[String]) {
25 let config = CliConfig::load(None);
26 run_shell(&config);
27 }
28}