rush_sync_server/commands/history/
history.rs1use crate::commands::command::Command;
10use crate::core::prelude::*;
11
12#[derive(Debug)]
13pub struct HistoryCommand;
14
15impl Command for HistoryCommand {
16 fn name(&self) -> &'static str {
17 "history"
18 }
19
20 fn description(&self) -> &'static str {
21 "Manage command history"
22 }
23
24 fn matches(&self, command: &str) -> bool {
25 command.trim().starts_with("history")
26 }
27
28 fn execute_sync(&self, args: &[&str]) -> Result<String> {
29 match args.first() {
30 Some(&"-c" | &"--clear") => Ok("__CLEAR_HISTORY__".to_string()),
31 Some(&"-h" | &"--help") => Ok(get_translation("system.commands.history.help", &[])),
32 _ => Ok(get_translation("system.commands.history.unknown", &[])),
33 }
34 }
35
36 fn priority(&self) -> u8 {
37 60 }
39}