Skip to main content

rush_sync_server/commands/clear/
command.rs

1use crate::commands::command::Command;
2use crate::core::prelude::*;
3
4#[derive(Debug)]
5pub struct ClearCommand;
6
7impl Command for ClearCommand {
8    fn name(&self) -> &'static str {
9        "clear"
10    }
11
12    fn description(&self) -> &'static str {
13        "Clear the screen"
14    }
15
16    fn matches(&self, command: &str) -> bool {
17        crate::matches_exact!(command, "clear" | "cls")
18    }
19
20    fn execute_sync(&self, _args: &[&str]) -> Result<String> {
21        Ok(crate::core::constants::SIG_CLEAR.to_string())
22    }
23
24    fn priority(&self) -> u8 {
25        80 // High priority for system command
26    }
27}