use clap::Command; use super::Cmd; #[derive(Debug, Default)] pub struct Clear; impl Cmd for Clear { fn name(&self) -> &str { "clear" } fn cli(&self) -> Command { Command::new("clear") .about("clear the terminal's screen") .author("Nathan Fisher") .version(env!("CARGO_PKG_VERSION")) } fn run(&self, _matches: Option<&clap::ArgMatches>) -> Result<(), Box> { print!("\x1b[2J\x1b[H"); print!("\x1b[3J\x1b[H"); Ok(()) } fn path(&self) -> Option { Some(crate::Path::UsrBin) } }