From 909fc01a4845c965622976a01a96e3e1237794b4 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 c382f73..0418470 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 9e257c4..1672e96 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 @@ -122,6 +122,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);