rush_sync_server/commands/version/
command.rs

1// =====================================================
2// FILE: commands/version/version.rs - TRAIT IMPL
3// =====================================================
4
5use crate::commands::command::Command;
6use crate::core::constants::VERSION;
7use crate::core::prelude::*;
8use crate::i18n::get_command_translation;
9
10#[derive(Debug)]
11pub struct VersionCommand;
12
13impl Command for VersionCommand {
14    fn name(&self) -> &'static str {
15        "version"
16    }
17
18    fn description(&self) -> &'static str {
19        "Show application version"
20    }
21
22    fn matches(&self, command: &str) -> bool {
23        crate::matches_exact!(command, "version" | "ver")
24    }
25
26    fn execute_sync(&self, _args: &[&str]) -> Result<String> {
27        Ok(get_command_translation(
28            "system.commands.version",
29            &[VERSION],
30        ))
31    }
32
33    fn priority(&self) -> u8 {
34        40 // Standard Priorität
35    }
36}