aboutsummaryrefslogtreecommitdiffstats
path: root/bin/alv
diff options
context:
space:
mode:
authors-ol <s-ol@users.noreply.github.com>2020-04-13 18:40:35 +0000
committers-ol <s-ol@users.noreply.github.com>2020-04-14 08:46:54 +0000
commit1a8debe87762072b3a63b769aa515ebf63b4c70d (patch)
tree33b42866307d11d2c0878b23e0ec0bb8925d3fcc /bin/alv
parentspec base.match __tostring (diff)
downloadalive-1a8debe87762072b3a63b769aa515ebf63b4c70d.tar.gz
alive-1a8debe87762072b3a63b769aa515ebf63b4c70d.zip
move into proper Lua module (`alv`)
Diffstat (limited to 'bin/alv')
-rwxr-xr-xbin/alv23
1 files changed, 23 insertions, 0 deletions
diff --git a/bin/alv b/bin/alv
new file mode 100755
index 0000000..6abe6c8
--- /dev/null
+++ b/bin/alv
@@ -0,0 +1,23 @@
+#!/usr/bin/env moon
+import Copilot, Logger from require 'alv'
+import sleep from require 'system'
+
+arguments, key = {}
+for a in *arg
+ if match = a\match '^%-%-(.*)'
+ key = match
+ arguments[key] = true
+ elseif key
+ arguments[key] = a
+ key = nil
+ else
+ table.insert arguments, a
+
+Logger.init arguments.log
+
+assert arguments[1], "no filename given"
+copilot = Copilot arguments[1]
+
+while true
+ copilot\tick!
+ sleep 1 / 1000