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