2023-01-12 18:33:41 -05:00
|
|
|
use super::Cmd;
|
2023-01-12 19:00:16 -05:00
|
|
|
use clap::Command;
|
2023-01-12 18:33:41 -05:00
|
|
|
|
2023-04-17 23:27:57 -04:00
|
|
|
#[derive(Debug)]
|
2023-01-12 18:33:41 -05:00
|
|
|
pub struct Clear;
|
|
|
|
|
|
|
|
impl Cmd for Clear {
|
|
|
|
fn cli(&self) -> Command {
|
|
|
|
Command::new("clear")
|
|
|
|
.about("clear the terminal's screen")
|
|
|
|
.author("Nathan Fisher")
|
|
|
|
.version(env!("CARGO_PKG_VERSION"))
|
|
|
|
}
|
|
|
|
|
2023-02-04 08:54:27 -05:00
|
|
|
fn run(&self, _matches: &clap::ArgMatches) -> Result<(), Box<dyn std::error::Error>> {
|
2023-01-12 18:33:41 -05:00
|
|
|
print!("\x1b[2J\x1b[H");
|
|
|
|
print!("\x1b[3J\x1b[H");
|
|
|
|
Ok(())
|
|
|
|
}
|
|
|
|
|
2023-02-05 23:50:59 -05:00
|
|
|
fn path(&self) -> Option<shitbox::Path> {
|
|
|
|
Some(shitbox::Path::UsrBin)
|
2023-01-12 18:33:41 -05:00
|
|
|
}
|
|
|
|
}
|