From fdb6ab1c29bff5b25f6958a722fe3d52ad37374a Mon Sep 17 00:00:00 2001 From: Soispha Date: Wed, 26 Jul 2023 21:12:17 +0200 Subject: [PATCH] Fix(app::command_interface): Add a `greet_multiple()` func to test tables This is, like the `greet` function only here to debug the lua api. It outputs a table. --- src/tui_app/app/command_interface/mod.rs | 4 ++++ .../app/events/event_types/event/handlers/command.rs | 6 ++++++ 2 files changed, 10 insertions(+) diff --git a/src/tui_app/app/command_interface/mod.rs b/src/tui_app/app/command_interface/mod.rs index bb66168..b40bb9b 100644 --- a/src/tui_app/app/command_interface/mod.rs +++ b/src/tui_app/app/command_interface/mod.rs @@ -22,6 +22,10 @@ struct Commands { /// Greets the user greet: fn(String) -> String, + /// Returns a table of greeted users + greet_multiple: fn() -> Table, + // End debug functions + /// Closes the application exit: fn(), diff --git a/src/tui_app/app/events/event_types/event/handlers/command.rs b/src/tui_app/app/events/event_types/event/handlers/command.rs index 251a488..2d93e2f 100644 --- a/src/tui_app/app/events/event_types/event/handlers/command.rs +++ b/src/tui_app/app/events/event_types/event/handlers/command.rs @@ -110,6 +110,12 @@ pub async fn handle( send_main_output!("{}", output); EventStatus::Ok } + Command::GreetMultiple => { + let mut table: Table = HashMap::new(); + table.insert("UserName1".to_owned(), CommandTransferValue::Integer(2)); + send_main_output!(table); + EventStatus::Ok + } Command::Help(_) => todo!(), Command::RaiseError(err) => { send_error_output!(err);