From 355491143f7cd50114fa73eb3d7e4e805b538e16 Mon Sep 17 00:00:00 2001 From: Florent Date: Sun, 20 Apr 2025 08:07:17 +0200 Subject: [PATCH] script command --- src/meshcore_cli/meshcore_cli.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/meshcore_cli/meshcore_cli.py b/src/meshcore_cli/meshcore_cli.py index 0c460cb..c1eedea 100644 --- a/src/meshcore_cli/meshcore_cli.py +++ b/src/meshcore_cli/meshcore_cli.py @@ -195,6 +195,7 @@ def make_completion_dict(contacts): "rp" : None, "cp" : None, "cli" : None, + "script" : None, "$remove_contact" : contact_list, "$msg" : contact_list, "$cmd" : contact_list, @@ -237,11 +238,6 @@ Line starting with \"$\" or \".\" will issue a meshcli command. if res.type == EventType.NO_MORE_MSGS: break - completion_dict = { - "to": None, - "send": None, - } - completer = NestedCompleter.from_nested_dict(make_completion_dict(mc.contacts)) if os.path.isdir(MCCLI_CONFIG_DIR) : our_history = FileHistory(MCCLI_HISTORY_FILE) @@ -322,6 +318,7 @@ Line starting with \"$\" or \".\" will issue a meshcli command. line.startswith("chan") or\ line.startswith("card") or \ line.startswith("lc") or \ + line.startswith("script") or \ line == "infos" or line == "i" : args = shlex.split(line) await process_cmds(mc, args) @@ -1022,6 +1019,10 @@ async def next_cmd(mc, cmds, json_output=False): contact = mc.get_contact_by_name(cmds[1]) await interactive_loop(mc, to=contact) + case "script" : + argnum = 1 + await process_script(mc, cmds[1], json_output=json_output) + case "cli" | "@" : argnum = 1 res = await mc.commands.send_cli(cmds[1])