use crate::error::ShellError; mod cd; const BUILTINS: &[&str] = &["cd"]; pub fn is_builtin(keyword: &str) -> bool { BUILTINS.contains(&keyword) } pub fn execute_builtin(keyword: &str, args: &[&str]) -> Result<(), ShellError> { match keyword { "cd" => cd::run(args)?, _ => {} } Ok(()) } #[cfg(test)] mod tests { use super::*; #[test] fn test_is_builtin_cd() { assert_eq!(is_builtin("cd"), true); } }