summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--client.lua17
1 files changed, 17 insertions, 0 deletions
diff --git a/client.lua b/client.lua
new file mode 100644
index 0000000..1ea8dc3
--- /dev/null
+++ b/client.lua
@@ -0,0 +1,17 @@
+local cqueues = require("cqueues")
+local socket = require("cqueues.socket")
+
+function callcmd(conn, cmd)
+ conn:write(cmd.."\n")
+ print("response:", conn:read("*l"))
+end
+
+local socketpath = "/tmp/albotty.sock"
+local conn = socket.connect{path = socketpath}
+
+target,msg = ...
+for line in string.gmatch(msg, "[^\n]+") do
+ callcmd(conn, ("/msg %s %s"):format(target, line))
+end
+conn:close()
+