rush_sync_server/commands/test/
command.rs1use crate::commands::command::Command;
5use crate::core::prelude::*;
6
7#[derive(Debug)]
8pub struct TestCommand;
9
10impl Command for TestCommand {
11 fn name(&self) -> &'static str {
12 "test"
13 }
14
15 fn description(&self) -> &'static str {
16 "Test command for debugging output"
17 }
18
19 fn matches(&self, command: &str) -> bool {
20 command.trim().to_lowercase().starts_with("test")
21 }
22
23 fn execute_sync(&self, args: &[&str]) -> Result<String> {
24 match args.first() {
25 None => {
26 Ok("π₯ TEST: Einzeiliger Text funktioniert!".to_string())
28 }
29 Some(&"multi") => {
30 Ok(format!(
32 "π₯ TEST: Mehrzeiliger Text:\nZeile 1\nZeile 2\nZeile 3"
33 ))
34 }
35 Some(&"long") => {
36 Ok(format!(
38 "π₯ TEST: Sehr langer Text: Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua."
39 ))
40 }
41 Some(&"format") => {
42 Ok(format!(
44 "π₯ TEST Format:\n\
45 Line 1: Hello World\n\
46 Line 2: This is a test\n\
47 Line 3: With multiple lines"
48 ))
49 }
50 Some(&"emoji") => {
51 Ok("π¨π₯β
π―π Emoji Test funktioniert! π".to_string())
53 }
54 Some(&"theme") => {
55 Ok("π₯ TEST: Theme-Command wird aufgerufen - das funktioniert!".to_string())
57 }
58 Some(&"theme-help") => {
59 Ok(format!(
61 "π¨ TEST Theme Help:\nLine 1: theme\nLine 2: theme <name>\nLine 3: theme -h"
62 ))
63 }
64 _ => Ok(
65 "π₯ TEST Optionen: test, test multi, test long, test format, test emoji"
66 .to_string(),
67 ),
68 }
69 }
70
71 fn priority(&self) -> u8 {
72 10 }
74
75 fn is_available(&self) -> bool {
76 cfg!(debug_assertions) }
78}