use crate::errors::ShellError; use crate::object::Value; use std::path::PathBuf; pub trait CommandBlueprint { fn create( &self, args: crate::Args, host: &dyn crate::Host, env: &mut crate::Environment, ) -> Result, ShellError>; } crate enum CommandAction { ChangeCwd(PathBuf), } pub struct CommandSuccess { crate value: Value, crate action: Vec, } pub trait Command { fn begin(&mut self) -> Result<(), ShellError> { Ok(()) } fn run(&mut self) -> Result; fn end(&mut self) -> Result<(), ShellError> { Ok(()) } }